Skip to content

Commit

Permalink
change default gpu_thread
Browse files Browse the repository at this point in the history
  • Loading branch information
nlzy committed Nov 28, 2019
1 parent 6988eca commit 96c87bb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/vsw2xnvk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,12 @@ static void VS_CC filterCreate(const VSMap *in, VSMap *out, void *userData, VSCo
if (tileSize < 32)
throw std::string{ "tile size must be greater than or equal to 32" };

gpuThread = int64ToIntS(vsapi->propGetInt(in, "gpu_thread", 0, &err));
if (err || gpuThread <= 0)
gpuThread = 2;
int customGpuThread = int64ToIntS(vsapi->propGetInt(in, "gpu_thread", 0, &err));
if (customGpuThread > 0) {
gpuThread = customGpuThread;
} else {
gpuThread = int64ToIntS(ncnn::get_gpu_info(gpuId).transfer_queue_count);
}
gpuThread = std::min(gpuThread, int64ToIntS(ncnn::get_gpu_info(gpuId).compute_queue_count));

if (scale == 1 && noise == -1)
Expand Down

0 comments on commit 96c87bb

Please sign in to comment.