From b550ed18626c6fbeb5a6009131754118a39ff477 Mon Sep 17 00:00:00 2001 From: "Yuhsiang M. Tsai" Date: Sat, 1 Oct 2022 01:04:56 +0800 Subject: [PATCH] use get_num_multiprocessor --- cuda/solver/async_jacobi_kernels.cu | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cuda/solver/async_jacobi_kernels.cu b/cuda/solver/async_jacobi_kernels.cu index 109eb80e244..b5f6cd5aadf 100644 --- a/cuda/solver/async_jacobi_kernels.cu +++ b/cuda/solver/async_jacobi_kernels.cu @@ -88,9 +88,10 @@ void apply(std::shared_ptr exec, #if USE_DYNAMIC int oscb = DYNAMIC_OSCB; constexpr int subwarp_size = SUBWARP_SIZE; - int v100 = 80 * oscb; // V100 contains 80 SM - auto num_subwarp = v100 * default_block_size / subwarp_size; - int gridx = v100; + int num_blocks = + exec->get_num_multiprocessor() * oscb; // V100 contains 80 SM + auto num_subwarp = num_blocks * default_block_size / subwarp_size; + int gridx = num_blocks; if (num_subwarp > a->get_size()[0]) { gridx = a->get_size()[0] * subwarp_size / default_block_size; }