Skip to content

Commit 814e8bc

Browse files
committed
gpu: intel: sycl,ocl: properly propagate init_gpu_hw_info status
1 parent 90f53dd commit 814e8bc

File tree

5 files changed

+21
-25
lines changed

5 files changed

+21
-25
lines changed

src/gpu/intel/ocl/ocl_gpu_hw_info.cpp

+7-12
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ xpu::runtime_version_t get_driver_version(cl_device_id device) {
5555
return runtime_version;
5656
}
5757

58-
void init_gpu_hw_info(impl::engine_t *engine, cl_device_id device,
58+
status_t init_gpu_hw_info(impl::engine_t *engine, cl_device_id device,
5959
cl_context context, uint32_t &ip_version, compute::gpu_arch_t &gpu_arch,
6060
int &gpu_product_family, int &stepping_id, uint64_t &native_extensions,
6161
bool &mayiuse_systolic, bool &mayiuse_ngen_kernels) {
@@ -71,13 +71,9 @@ void init_gpu_hw_info(impl::engine_t *engine, cl_device_id device,
7171
stepping_id = product.stepping;
7272

7373
mayiuse_systolic = false;
74-
status_t ret
75-
= get_ocl_device_enabled_systolic_intel(device, mayiuse_systolic);
76-
assert(ret == CL_SUCCESS);
77-
ret = get_ocl_device_enabled_native_float_atomics(
78-
device, native_extensions, is_xelpg);
79-
assert(ret == CL_SUCCESS);
80-
MAYBE_UNUSED(ret);
74+
CHECK(get_ocl_device_enabled_systolic_intel(device, mayiuse_systolic));
75+
CHECK(get_ocl_device_enabled_native_float_atomics(
76+
device, native_extensions, is_xelpg));
8177

8278
auto status
8379
= jit::gpu_supports_binary_format(&mayiuse_ngen_kernels, engine);
@@ -88,10 +84,9 @@ void init_gpu_hw_info(impl::engine_t *engine, cl_device_id device,
8884
}
8985

9086
ip_version = 0;
91-
if (clGetDeviceInfo(device, CL_DEVICE_IP_VERSION_INTEL, sizeof(ip_version),
92-
&ip_version, nullptr)
93-
!= CL_SUCCESS)
94-
ip_version = 0;
87+
OCL_CHECK(clGetDeviceInfo(device, CL_DEVICE_IP_VERSION_INTEL,
88+
sizeof(ip_version), &ip_version, nullptr));
89+
return status::success;
9590
}
9691

9792
} // namespace ocl

src/gpu/intel/ocl/ocl_gpu_hw_info.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace ocl {
3030

3131
xpu::runtime_version_t get_driver_version(cl_device_id device);
3232

33-
void init_gpu_hw_info(impl::engine_t *engine, cl_device_id device,
33+
status_t init_gpu_hw_info(impl::engine_t *engine, cl_device_id device,
3434
cl_context context, uint32_t &ip_version, compute::gpu_arch_t &gpu_arch,
3535
int &gpu_product_family, int &stepping_id, uint64_t &native_extensions,
3636
bool &mayiuse_systolic, bool &mayiuse_ngen_kernels);

src/gpu/intel/sycl/device_info.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ status_t device_info_t::init_arch(impl::engine_t *engine) {
4343
// skip other vendors
4444
if (!xpu::sycl::is_intel_device(device)) return status::success;
4545

46+
auto status = status::success;
4647
auto be = xpu::sycl::get_backend(device);
4748
if (be == xpu::sycl::backend_t::opencl) {
4849
auto ocl_dev = xpu::sycl::compat::get_native<cl_device_id>(device);
@@ -51,22 +52,23 @@ status_t device_info_t::init_arch(impl::engine_t *engine) {
5152
auto ocl_ctx = xpu::sycl::compat::get_native<cl_context>(ctx);
5253
auto ocl_ctx_wrapper = xpu::ocl::make_wrapper(ocl_ctx);
5354

54-
gpu::intel::ocl::init_gpu_hw_info(engine, ocl_dev_wrapper,
55+
status = gpu::intel::ocl::init_gpu_hw_info(engine, ocl_dev_wrapper,
5556
ocl_ctx_wrapper, ip_version_, gpu_arch_, gpu_product_family_,
5657
stepping_id_, native_extensions_, mayiuse_systolic_,
5758
mayiuse_ngen_kernels_);
5859
} else if (be == xpu::sycl::backend_t::level0) {
5960
auto ze_dev = xpu::sycl::compat::get_native<ze_device_handle_t>(device);
6061
auto ze_ctx = xpu::sycl::compat::get_native<ze_context_handle_t>(ctx);
6162

62-
gpu::intel::sycl::init_gpu_hw_info(engine, ze_dev, ze_ctx, ip_version_,
63-
gpu_arch_, gpu_product_family_, stepping_id_,
63+
status = gpu::intel::sycl::init_gpu_hw_info(engine, ze_dev, ze_ctx,
64+
ip_version_, gpu_arch_, gpu_product_family_, stepping_id_,
6465
native_extensions_, mayiuse_systolic_, mayiuse_ngen_kernels_);
6566
} else {
6667
assert(!"not_expected");
68+
status = status::unimplemented;
6769
}
6870

69-
return status::success;
71+
return status;
7072
}
7173

7274
status_t device_info_t::init_device_name(impl::engine_t *engine) {

src/gpu/intel/sycl/l0/utils.cpp

+6-7
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ status_t get_l0_device_eu_count(ze_device_handle_t device, int &eu_count) {
366366
return status::success;
367367
}
368368

369-
void init_gpu_hw_info(impl::engine_t *engine, ze_device_handle_t device,
369+
status_t init_gpu_hw_info(impl::engine_t *engine, ze_device_handle_t device,
370370
ze_context_handle_t context, uint32_t &ip_version,
371371
compute::gpu_arch_t &gpu_arch, int &gpu_product_family,
372372
int &stepping_id, uint64_t &native_extensions, bool &mayiuse_systolic,
@@ -382,18 +382,17 @@ void init_gpu_hw_info(impl::engine_t *engine, ze_device_handle_t device,
382382
stepping_id = product.stepping;
383383

384384
mayiuse_systolic = false;
385-
status_t ret
386-
= get_l0_device_enabled_systolic_intel(device, mayiuse_systolic);
387-
// TODO: xelpg has no f64 support. check that the query properly handle that
388-
ret = get_l0_device_enabled_native_float_atomics(device, native_extensions);
389-
MAYBE_UNUSED(ret);
385+
CHECK(get_l0_device_enabled_systolic_intel(device, mayiuse_systolic));
386+
387+
CHECK(get_l0_device_enabled_native_float_atomics(
388+
device, native_extensions));
390389

391390
auto status
392391
= jit::gpu_supports_binary_format(&mayiuse_ngen_kernels, engine);
393392
if (status != status::success) mayiuse_ngen_kernels = false;
394393

395394
ip_version = 0;
396-
get_device_ip(device, ip_version);
395+
return get_device_ip(device, ip_version);
397396
}
398397

399398
} // namespace sycl

src/gpu/intel/sycl/l0/utils.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ bool compare_ze_devices(const ::sycl::device &lhs, const ::sycl::device &rhs);
4545
status_t func_zeModuleGetNativeBinary(ze_module_handle_t hModule, size_t *pSize,
4646
uint8_t *pModuleNativeBinary);
4747

48-
void init_gpu_hw_info(impl::engine_t *engine, ze_device_handle_t device,
48+
status_t init_gpu_hw_info(impl::engine_t *engine, ze_device_handle_t device,
4949
ze_context_handle_t context, uint32_t &ip_version,
5050
compute::gpu_arch_t &gpu_arch, int &gpu_product_family,
5151
int &stepping_id, uint64_t &native_extensions, bool &mayiuse_systolic,

0 commit comments

Comments
 (0)