From 8e9e4433d3ec20026fe4f6c064629b8263e6df4e Mon Sep 17 00:00:00 2001 From: nagadomi Date: Fri, 15 Apr 2016 09:15:19 +0900 Subject: [PATCH] Add thread option to benchmark --- tools/benchmark.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/benchmark.lua b/tools/benchmark.lua index 93b4cf1..6c5de4c 100644 --- a/tools/benchmark.lua +++ b/tools/benchmark.lua @@ -33,6 +33,7 @@ cmd:option("-show_progress", 1, 'show progressbar') cmd:option("-baseline_filter", "Catrom", 'baseline interpolation (Box|Lanczos|Catrom(Bicubic))') cmd:option("-save_info", 0, 'save score and parameters to benchmark.txt') cmd:option("-save_all", 0, 'group -save_info, -save_image and -save_baseline_image option') +cmd:option("-thread", -1, 'number of CPU threads') local function to_bool(settings, name) if settings[name] == 1 then @@ -59,6 +60,9 @@ else to_bool(opt, "save_baseline_image") end to_bool(opt, "show_progress") +if opt.thread > 0 then + torch.setnumthreads(tonumber(opt.thread)) +end local function rgb2y_matlab(x) local y = torch.Tensor(1, x:size(2), x:size(3)):zero()