File tree Expand file tree Collapse file tree 7 files changed +36
-10
lines changed
test/conformance/platform Expand file tree Collapse file tree 7 files changed +36
-10
lines changed Original file line number Diff line number Diff line change @@ -253,7 +253,11 @@ class ur_rect_region_t(Structure):
253253###############################################################################
254254## @brief Supported device initialization flags
255255class ur_device_init_flags_v (IntEnum ):
256- GPU = UR_BIT (0 ) ## initialize GPU device drivers
256+ GPU = UR_BIT (0 ) ## initialize GPU device drivers.
257+ CPU = UR_BIT (1 ) ## initialize CPU device drivers.
258+ FPGA = UR_BIT (2 ) ## initialize FPGA device drivers.
259+ MCA = UR_BIT (3 ) ## initialize MCA device drivers.
260+ VPU = UR_BIT (4 ) ## initialize VPU device drivers.
257261
258262class ur_device_init_flags_t (c_int ):
259263 def __str__ (self ):
Original file line number Diff line number Diff line change @@ -285,7 +285,11 @@ typedef struct ur_rect_region_t {
285285/// @brief Supported device initialization flags
286286typedef uint32_t ur_device_init_flags_t ;
287287typedef enum ur_device_init_flag_t {
288- UR_DEVICE_INIT_FLAG_GPU = UR_BIT (0 ), ///< initialize GPU device drivers
288+ UR_DEVICE_INIT_FLAG_GPU = UR_BIT (0 ), ///< initialize GPU device drivers.
289+ UR_DEVICE_INIT_FLAG_CPU = UR_BIT (1 ), ///< initialize CPU device drivers.
290+ UR_DEVICE_INIT_FLAG_FPGA = UR_BIT (2 ), ///< initialize FPGA device drivers.
291+ UR_DEVICE_INIT_FLAG_MCA = UR_BIT (3 ), ///< initialize MCA device drivers.
292+ UR_DEVICE_INIT_FLAG_VPU = UR_BIT (4 ), ///< initialize VPU device drivers.
289293 /// @cond
290294 UR_DEVICE_INIT_FLAG_FORCE_UINT32 = 0x7fffffff
291295 /// @endcond
@@ -314,7 +318,7 @@ typedef enum ur_device_init_flag_t {
314318/// - ::UR_RESULT_ERROR_UNINITIALIZED
315319/// - ::UR_RESULT_ERROR_DEVICE_LOST
316320/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
317- /// + `0x1 < device_flags`
321+ /// + `0x1f < device_flags`
318322/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
319323UR_APIEXPORT ur_result_t UR_APICALL
320324urInit (
Original file line number Diff line number Diff line change @@ -16,7 +16,15 @@ class: $x
1616name : $x_device_init_flags_t
1717etors :
1818 - name : GPU
19- desc : " initialize GPU device drivers"
19+ desc : " initialize GPU device drivers."
20+ - name : CPU
21+ desc : " initialize CPU device drivers."
22+ - name : FPGA
23+ desc : " initialize FPGA device drivers."
24+ - name : MCA
25+ desc : " initialize MCA device drivers."
26+ - name : VPU
27+ desc : " initialize VPU device drivers."
2028--- # --------------------------------------------------------------------------
2129type : function
2230desc : " Initialize the $OneApi driver(s)"
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ __urdlllocal ur_result_t UR_APICALL urInit(
2323 }
2424
2525 if (context.enableParameterValidation ) {
26- if (0x1 < device_flags) {
26+ if (0x1f < device_flags) {
2727 return UR_RESULT_ERROR_INVALID_ENUMERATION;
2828 }
2929 }
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ extern "C" {
3535// / - ::UR_RESULT_ERROR_UNINITIALIZED
3636// / - ::UR_RESULT_ERROR_DEVICE_LOST
3737// / - ::UR_RESULT_ERROR_INVALID_ENUMERATION
38- // / + `0x1 < device_flags`
38+ // / + `0x1f < device_flags`
3939// / - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
4040ur_result_t UR_APICALL urInit (
4141 ur_device_init_flags_t device_flags // /< [in] device initialization flags.
Original file line number Diff line number Diff line change 3232// / - ::UR_RESULT_ERROR_UNINITIALIZED
3333// / - ::UR_RESULT_ERROR_DEVICE_LOST
3434// / - ::UR_RESULT_ERROR_INVALID_ENUMERATION
35- // / + `0x1 < device_flags`
35+ // / + `0x1f < device_flags`
3636// / - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
3737ur_result_t UR_APICALL urInit (
3838 ur_device_init_flags_t device_flags // /< [in] device initialization flags.
Original file line number Diff line number Diff line change 22// SPDX-License-Identifier: MIT
33#include < uur/checks.h>
44
5- TEST (urInitTest, Success) {
6- ur_device_init_flags_t device_flags = 0 ;
5+ using urInitTestWithParam = ::testing::TestWithParam<ur_device_init_flags_t >;
6+ INSTANTIATE_TEST_SUITE_P (
7+ , urInitTestWithParam,
8+ ::testing::Values (UR_DEVICE_INIT_FLAG_GPU, UR_DEVICE_INIT_FLAG_CPU,
9+ UR_DEVICE_INIT_FLAG_FPGA, UR_DEVICE_INIT_FLAG_MCA,
10+ UR_DEVICE_INIT_FLAG_VPU,
11+ /* Combinations */
12+ UR_DEVICE_INIT_FLAG_GPU | UR_DEVICE_INIT_FLAG_CPU,
13+ UR_DEVICE_INIT_FLAG_FPGA | UR_DEVICE_INIT_FLAG_VPU));
14+
15+ TEST_P (urInitTestWithParam, Success) {
16+ ur_device_init_flags_t device_flags = GetParam ();
717 ASSERT_SUCCESS (urInit (device_flags));
818
9- ur_tear_down_params_t tear_down_params{};
19+ ur_tear_down_params_t tear_down_params{nullptr };
1020 ASSERT_SUCCESS (urTearDown (&tear_down_params));
1121}
1222
You can’t perform that action at this time.
0 commit comments