diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-10-20 21:40:32 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-10-21 14:08:10 +0300 |
commit | 39810b3f5163cb934c87db4e623b2ae41901cef3 (patch) | |
tree | c8d90317585faf306e8dca556441e31933dca853 /intern/cycles/device/cuda | |
parent | 6ef8c9e6461456354c5e6b95a1d5cc7176723fe0 (diff) |
Cleanup: make HIP and CUDA code more consistent
Ref D12834
Diffstat (limited to 'intern/cycles/device/cuda')
-rw-r--r-- | intern/cycles/device/cuda/queue.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/intern/cycles/device/cuda/queue.cpp b/intern/cycles/device/cuda/queue.cpp index 1149a835b14..6b2c9a40082 100644 --- a/intern/cycles/device/cuda/queue.cpp +++ b/intern/cycles/device/cuda/queue.cpp @@ -41,13 +41,19 @@ CUDADeviceQueue::~CUDADeviceQueue() int CUDADeviceQueue::num_concurrent_states(const size_t state_size) const { - int num_states = max(cuda_device_->get_num_multiprocessors() * - cuda_device_->get_max_num_threads_per_multiprocessor() * 16, - 1048576); + const int max_num_threads = cuda_device_->get_num_multiprocessors() * + cuda_device_->get_max_num_threads_per_multiprocessor(); + int num_states = max(max_num_threads, 65536) * 16; const char *factor_str = getenv("CYCLES_CONCURRENT_STATES_FACTOR"); if (factor_str) { - num_states = max((int)(num_states * atof(factor_str)), 1024); + const float factor = (float)atof(factor_str); + if (factor != 0.0f) { + num_states = max((int)(num_states * factor), 1024); + } + else { + VLOG(3) << "CYCLES_CONCURRENT_STATES_FACTOR evaluated to 0"; + } } VLOG(3) << "GPU queue concurrent states: " << num_states << ", using up to " |