mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 04:48:08 +08:00
Add ze_init_flag_t check to zeInit()
Return an error and don't init if flag is non-zero and GPU_ONLY flag is not set Signed-off-by: Brandon Yates <brandon.yates@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ec18046f24
commit
1980edd05b
@@ -115,6 +115,10 @@ ze_result_t driverHandleGet(uint32_t *pCount, ze_driver_handle_t *phDriverHandle
|
||||
static DriverImp driverImp;
|
||||
Driver *Driver::driver = &driverImp;
|
||||
|
||||
ze_result_t init(ze_init_flags_t flags) { return Driver::get()->driverInit(flags); }
|
||||
|
||||
ze_result_t init(ze_init_flags_t flags) {
|
||||
if (flags && !(flags & ZE_INIT_FLAG_GPU_ONLY))
|
||||
return ZE_RESULT_ERROR_UNINITIALIZED;
|
||||
else
|
||||
return Driver::get()->driverInit(flags);
|
||||
}
|
||||
} // namespace L0
|
||||
|
||||
Reference in New Issue
Block a user