@@ -947,35 +947,36 @@ ur_result_t urKernelSetExecInfo(
947947 std::ignore = PropSize;
948948 std::ignore = Properties;
949949
950- auto ZeKernel = Kernel->ZeKernel ;
951950 std::scoped_lock<ur_shared_mutex> Guard (Kernel->Mutex );
952- if (PropName == UR_KERNEL_EXEC_INFO_USM_INDIRECT_ACCESS &&
953- *(static_cast <const ur_bool_t *>(PropValue)) == true ) {
954- // The whole point for users really was to not need to know anything
955- // about the types of allocations kernel uses. So in DPC++ we always
956- // just set all 3 modes for each kernel.
957- ze_kernel_indirect_access_flags_t IndirectFlags =
958- ZE_KERNEL_INDIRECT_ACCESS_FLAG_HOST |
959- ZE_KERNEL_INDIRECT_ACCESS_FLAG_DEVICE |
960- ZE_KERNEL_INDIRECT_ACCESS_FLAG_SHARED;
961- ZE2UR_CALL (zeKernelSetIndirectAccess, (ZeKernel, IndirectFlags));
962- } else if (PropName == UR_KERNEL_EXEC_INFO_CACHE_CONFIG) {
963- ze_cache_config_flag_t ZeCacheConfig{};
964- auto CacheConfig =
965- *(static_cast <const ur_kernel_cache_config_t *>(PropValue));
966- if (CacheConfig == UR_KERNEL_CACHE_CONFIG_LARGE_SLM)
967- ZeCacheConfig = ZE_CACHE_CONFIG_FLAG_LARGE_SLM;
968- else if (CacheConfig == UR_KERNEL_CACHE_CONFIG_LARGE_DATA)
969- ZeCacheConfig = ZE_CACHE_CONFIG_FLAG_LARGE_DATA;
970- else if (CacheConfig == UR_KERNEL_CACHE_CONFIG_DEFAULT)
971- ZeCacheConfig = static_cast <ze_cache_config_flag_t >(0 );
972- else
973- // Unexpected cache configuration value.
951+ for (auto &ZeKernel : Kernel->ZeKernels ) {
952+ if (PropName == UR_KERNEL_EXEC_INFO_USM_INDIRECT_ACCESS &&
953+ *(static_cast <const ur_bool_t *>(PropValue)) == true ) {
954+ // The whole point for users really was to not need to know anything
955+ // about the types of allocations kernel uses. So in DPC++ we always
956+ // just set all 3 modes for each kernel.
957+ ze_kernel_indirect_access_flags_t IndirectFlags =
958+ ZE_KERNEL_INDIRECT_ACCESS_FLAG_HOST |
959+ ZE_KERNEL_INDIRECT_ACCESS_FLAG_DEVICE |
960+ ZE_KERNEL_INDIRECT_ACCESS_FLAG_SHARED;
961+ ZE2UR_CALL (zeKernelSetIndirectAccess, (ZeKernel, IndirectFlags));
962+ } else if (PropName == UR_KERNEL_EXEC_INFO_CACHE_CONFIG) {
963+ ze_cache_config_flag_t ZeCacheConfig{};
964+ auto CacheConfig =
965+ *(static_cast <const ur_kernel_cache_config_t *>(PropValue));
966+ if (CacheConfig == UR_KERNEL_CACHE_CONFIG_LARGE_SLM)
967+ ZeCacheConfig = ZE_CACHE_CONFIG_FLAG_LARGE_SLM;
968+ else if (CacheConfig == UR_KERNEL_CACHE_CONFIG_LARGE_DATA)
969+ ZeCacheConfig = ZE_CACHE_CONFIG_FLAG_LARGE_DATA;
970+ else if (CacheConfig == UR_KERNEL_CACHE_CONFIG_DEFAULT)
971+ ZeCacheConfig = static_cast <ze_cache_config_flag_t >(0 );
972+ else
973+ // Unexpected cache configuration value.
974+ return UR_RESULT_ERROR_INVALID_VALUE;
975+ ZE2UR_CALL (zeKernelSetCacheConfig, (ZeKernel, ZeCacheConfig););
976+ } else {
977+ logger::error (" urKernelSetExecInfo: unsupported ParamName" );
974978 return UR_RESULT_ERROR_INVALID_VALUE;
975- ZE2UR_CALL (zeKernelSetCacheConfig, (ZeKernel, ZeCacheConfig););
976- } else {
977- logger::error (" urKernelSetExecInfo: unsupported ParamName" );
978- return UR_RESULT_ERROR_INVALID_VALUE;
979+ }
979980 }
980981
981982 return UR_RESULT_SUCCESS;
0 commit comments