diff --git a/src/modules/module_09700.c b/src/modules/module_09700.c index cad911186..626f65f8f 100644 --- a/src/modules/module_09700.c +++ b/src/modules/module_09700.c @@ -69,21 +69,13 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY } else if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) { - if (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK) + if (device_param->device_local_mem_size < 49152) { - native_threads = 8; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD) - { - native_threads = 64; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP) - { - native_threads = 64; + native_threads = MIN (device_param->kernel_preferred_wgs_multiple, 32); // We can't just set 32, because Intel GPU need 8 } else { - native_threads = 32; + native_threads = device_param->kernel_preferred_wgs_multiple; } } diff --git a/src/modules/module_09710.c b/src/modules/module_09710.c index 033f77ea0..aa63f6905 100644 --- a/src/modules/module_09710.c +++ b/src/modules/module_09710.c @@ -69,21 +69,13 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY } else if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) { - if (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK) + if (device_param->device_local_mem_size < 49152) { - native_threads = 8; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD) - { - native_threads = 64; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP) - { - native_threads = 64; + native_threads = MIN (device_param->kernel_preferred_wgs_multiple, 32); // We can't just set 32, because Intel GPU need 8 } else { - native_threads = 32; + native_threads = device_param->kernel_preferred_wgs_multiple; } } diff --git a/src/modules/module_09720.c b/src/modules/module_09720.c index 04e99201f..e4be9f8b0 100644 --- a/src/modules/module_09720.c +++ b/src/modules/module_09720.c @@ -70,21 +70,13 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY } else if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) { - if (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK) + if (device_param->device_local_mem_size < 49152) { - native_threads = 8; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD) - { - native_threads = 64; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP) - { - native_threads = 64; + native_threads = MIN (device_param->kernel_preferred_wgs_multiple, 32); // We can't just set 32, because Intel GPU need 8 } else { - native_threads = 32; + native_threads = device_param->kernel_preferred_wgs_multiple; } } diff --git a/src/modules/module_09800.c b/src/modules/module_09800.c index 2eb7fab05..357ecb80b 100644 --- a/src/modules/module_09800.c +++ b/src/modules/module_09800.c @@ -71,21 +71,13 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY } else if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) { - if (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK) + if (device_param->device_local_mem_size < 49152) { - native_threads = 8; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD) - { - native_threads = 64; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP) - { - native_threads = 64; + native_threads = MIN (device_param->kernel_preferred_wgs_multiple, 32); // We can't just set 32, because Intel GPU need 8 } else { - native_threads = 32; + native_threads = device_param->kernel_preferred_wgs_multiple; } } diff --git a/src/modules/module_09810.c b/src/modules/module_09810.c index 2a1074b2c..9d3edd8d2 100644 --- a/src/modules/module_09810.c +++ b/src/modules/module_09810.c @@ -70,21 +70,13 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY } else if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) { - if (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK) + if (device_param->device_local_mem_size < 49152) { - native_threads = 8; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD) - { - native_threads = 64; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP) - { - native_threads = 64; + native_threads = MIN (device_param->kernel_preferred_wgs_multiple, 32); // We can't just set 32, because Intel GPU need 8 } else { - native_threads = 32; + native_threads = device_param->kernel_preferred_wgs_multiple; } } diff --git a/src/modules/module_09820.c b/src/modules/module_09820.c index ea3dfe22b..9997992e4 100644 --- a/src/modules/module_09820.c +++ b/src/modules/module_09820.c @@ -72,21 +72,13 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY } else if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) { - if (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK) + if (device_param->device_local_mem_size < 49152) { - native_threads = 8; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD) - { - native_threads = 64; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP) - { - native_threads = 64; + native_threads = MIN (device_param->kernel_preferred_wgs_multiple, 32); // We can't just set 32, because Intel GPU need 8 } else { - native_threads = 32; + native_threads = device_param->kernel_preferred_wgs_multiple; } } diff --git a/src/modules/module_10400.c b/src/modules/module_10400.c index 77416f5ce..30c95e68a 100644 --- a/src/modules/module_10400.c +++ b/src/modules/module_10400.c @@ -76,21 +76,13 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY } else if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) { - if (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK) + if (device_param->device_local_mem_size < 49152) { - native_threads = 8; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD) - { - native_threads = 64; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP) - { - native_threads = 64; + native_threads = MIN (device_param->kernel_preferred_wgs_multiple, 32); // We can't just set 32, because Intel GPU need 8 } else { - native_threads = 32; + native_threads = device_param->kernel_preferred_wgs_multiple; } } diff --git a/src/modules/module_10410.c b/src/modules/module_10410.c index b2c98363f..25be1feb4 100644 --- a/src/modules/module_10410.c +++ b/src/modules/module_10410.c @@ -77,21 +77,13 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY } else if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) { - if (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK) + if (device_param->device_local_mem_size < 49152) { - native_threads = 8; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD) - { - native_threads = 64; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP) - { - native_threads = 64; + native_threads = MIN (device_param->kernel_preferred_wgs_multiple, 32); // We can't just set 32, because Intel GPU need 8 } else { - native_threads = 32; + native_threads = device_param->kernel_preferred_wgs_multiple; } } diff --git a/src/modules/module_10420.c b/src/modules/module_10420.c index 23e537bf5..eecf97f2c 100644 --- a/src/modules/module_10420.c +++ b/src/modules/module_10420.c @@ -76,21 +76,13 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY } else if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) { - if (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK) + if (device_param->device_local_mem_size < 49152) { - native_threads = 8; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD) - { - native_threads = 64; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP) - { - native_threads = 64; + native_threads = MIN (device_param->kernel_preferred_wgs_multiple, 32); // We can't just set 32, because Intel GPU need 8 } else { - native_threads = 32; + native_threads = device_param->kernel_preferred_wgs_multiple; } } diff --git a/src/modules/module_10500.c b/src/modules/module_10500.c index 80a8478ef..d261e4458 100644 --- a/src/modules/module_10500.c +++ b/src/modules/module_10500.c @@ -100,21 +100,13 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY } else if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) { - if (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK) + if (device_param->device_local_mem_size < 49152) { - native_threads = 8; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD) - { - native_threads = 64; - } - else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP) - { - native_threads = 64; + native_threads = MIN (device_param->kernel_preferred_wgs_multiple, 32); // We can't just set 32, because Intel GPU need 8 } else { - native_threads = 32; + native_threads = device_param->kernel_preferred_wgs_multiple; } }