Skip to content

Commit dc830ad

Browse files
committed
gpu: intel: sycl,ocl: properly propagate init_gpu_hw_info status
1 parent b63debf commit dc830ad

File tree

5 files changed

+23
-27
lines changed

5 files changed

+23
-27
lines changed

src/gpu/intel/ocl/ocl_gpu_hw_info.cpp

+8-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2020-2024 Intel Corporation
2+
* Copyright 2020-2025 Intel Corporation
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2020-2024 Intel Corporation
2+
* Copyright 2020-2025 Intel Corporation
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -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
@@ -371,7 +371,7 @@ status_t get_l0_device_eu_count(ze_device_handle_t device, int &eu_count) {
371371
return status::success;
372372
}
373373

374-
void init_gpu_hw_info(impl::engine_t *engine, ze_device_handle_t device,
374+
status_t init_gpu_hw_info(impl::engine_t *engine, ze_device_handle_t device,
375375
ze_context_handle_t context, uint32_t &ip_version,
376376
compute::gpu_arch_t &gpu_arch, int &gpu_product_family,
377377
int &stepping_id, uint64_t &native_extensions, bool &mayiuse_systolic,
@@ -387,18 +387,17 @@ void init_gpu_hw_info(impl::engine_t *engine, ze_device_handle_t device,
387387
stepping_id = product.stepping;
388388

389389
mayiuse_systolic = false;
390-
status_t ret
391-
= get_l0_device_enabled_systolic_intel(device, mayiuse_systolic);
392-
// TODO: xelpg has no f64 support. check that the query properly handle that
393-
ret = get_l0_device_enabled_native_float_atomics(device, native_extensions);
394-
MAYBE_UNUSED(ret);
390+
CHECK(get_l0_device_enabled_systolic_intel(device, mayiuse_systolic));
391+
392+
CHECK(get_l0_device_enabled_native_float_atomics(
393+
device, native_extensions));
395394

396395
auto status
397396
= jit::gpu_supports_binary_format(&mayiuse_ngen_kernels, engine);
398397
if (status != status::success) mayiuse_ngen_kernels = false;
399398

400399
ip_version = 0;
401-
get_device_ip(device, ip_version);
400+
return get_device_ip(device, ip_version);
402401
}
403402

404403
} // 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)