Skip to content

Commit ef0e07f

Browse files
committed
Merge branch 'llvm' into review/yang/invalid_arguments
2 parents 1391baa + e161516 commit ef0e07f

37 files changed

+432
-173
lines changed

.github/workflows/e2e_level_zero.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
config: ""
2222
unit: "gpu"
2323
# Failing tests
24-
xfail: "ESIMD/regression/minmax.cpp;ESIMD/preemption.cpp;Matrix/SG32/element_wise_all_ops.cpp;Matrix/SG32/get_coord_int8_matB.cpp;Matrix/element_wise_all_ops.cpp;Matrix/element_wise_all_ops_1d.cpp;Matrix/element_wise_all_ops_1d_cont.cpp;Matrix/element_wise_all_ops_scalar.cpp;Matrix/element_wise_ops.cpp;Matrix/get_coord_int8_matB.cpp;Matrix/joint_matrix_apply_bf16.cpp;Matrix/joint_matrix_apply_two_matrices.cpp;Matrix/joint_matrix_bfloat16.cpp;Matrix/joint_matrix_bfloat16_array.cpp;Matrix/joint_matrix_rowmajorA_rowmajorB.cpp;ProgramManager/uneven_kernel_split.cpp"
24+
xfail: "Matrix/SG32/get_coord_int8_matB.cpp;Matrix/element_wise_all_ops_1d.cpp;Matrix/element_wise_all_ops_1d_cont.cpp;Matrix/element_wise_all_ops_scalar.cpp;Matrix/get_coord_int8_matB.cpp;Matrix/joint_matrix_rowmajorA_rowmajorB.cpp;Plugin/level_zero_barrier_optimization.cpp"
2525
# Flaky tests
2626
filter_out: "UserDefinedReductions/user_defined_reductions.cpp"
2727
# These runners by default spawn upwards of 260 workers.
2828
# We also add a time out just in case some test hangs
29-
extra_lit_flags: "-sv -j 100 --max-time 600"
29+
extra_lit_flags: "--param gpu-intel-pvc=True -sv -j 100 --max-time 600"

.github/workflows/multi_device.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ jobs:
5555

5656
- name: Test adapter specific
5757
working-directory: ${{github.workspace}}/build
58-
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180
58+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" -E "test-adapter-level_zero_multi_queue" --timeout 180
59+
# TODO: investigate why test-adapter-level_zero_multi_queue fails on newer driver
5960

6061
- name: Test adapters
6162
working-directory: ${{github.workspace}}/build

include/ur_api.h

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,16 +2401,19 @@ typedef struct ur_context_native_properties_t {
24012401
/// - ::UR_RESULT_ERROR_UNINITIALIZED
24022402
/// - ::UR_RESULT_ERROR_DEVICE_LOST
24032403
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
2404+
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
2405+
/// + `NULL == hAdapter`
24042406
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
2405-
/// + `NULL == phDevices`
24062407
/// + `NULL == phContext`
24072408
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
24082409
/// + If the adapter has no underlying equivalent handle.
24092410
UR_APIEXPORT ur_result_t UR_APICALL
24102411
urContextCreateWithNativeHandle(
24112412
ur_native_handle_t hNativeContext, ///< [in][nocheck] the native handle of the context.
2413+
ur_adapter_handle_t hAdapter, ///< [in] handle of the adapter that owns the native handle
24122414
uint32_t numDevices, ///< [in] number of devices associated with the context
2413-
const ur_device_handle_t *phDevices, ///< [in][range(0, numDevices)] list of devices associated with the context
2415+
const ur_device_handle_t *phDevices, ///< [in][optional][range(0, numDevices)] list of devices associated with
2416+
///< the context
24142417
const ur_context_native_properties_t *pProperties, ///< [in][optional] pointer to native context properties struct
24152418
ur_context_handle_t *phContext ///< [out] pointer to the handle of the context object created.
24162419
);
@@ -5278,6 +5281,8 @@ typedef struct ur_kernel_native_properties_t {
52785281
/// - The application may call this function from simultaneous threads for
52795282
/// the same context.
52805283
/// - The implementation of this function should be thread-safe.
5284+
/// - The implementation may require a valid program handle to return the
5285+
/// native kernel handle
52815286
///
52825287
/// @returns
52835288
/// - ::UR_RESULT_SUCCESS
@@ -5286,7 +5291,7 @@ typedef struct ur_kernel_native_properties_t {
52865291
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
52875292
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
52885293
/// + `NULL == hContext`
5289-
/// + `NULL == hProgram`
5294+
/// + If `hProgram == NULL` and the implementation requires a valid program.
52905295
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
52915296
/// + `NULL == phKernel`
52925297
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
@@ -5295,7 +5300,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
52955300
urKernelCreateWithNativeHandle(
52965301
ur_native_handle_t hNativeKernel, ///< [in][nocheck] the native handle of the kernel.
52975302
ur_context_handle_t hContext, ///< [in] handle of the context object
5298-
ur_program_handle_t hProgram, ///< [in] handle of the program associated with the kernel
5303+
ur_program_handle_t hProgram, ///< [in][optional] handle of the program associated with the kernel
52995304
const ur_kernel_native_properties_t *pProperties, ///< [in][optional] pointer to native kernel properties struct
53005305
ur_kernel_handle_t *phKernel ///< [out] pointer to the handle of the kernel object created.
53015306
);
@@ -5625,7 +5630,6 @@ typedef struct ur_queue_native_properties_t {
56255630
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
56265631
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
56275632
/// + `NULL == hContext`
5628-
/// + `NULL == hDevice`
56295633
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
56305634
/// + `NULL == phQueue`
56315635
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
@@ -5634,7 +5638,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
56345638
urQueueCreateWithNativeHandle(
56355639
ur_native_handle_t hNativeQueue, ///< [in][nocheck] the native handle of the queue.
56365640
ur_context_handle_t hContext, ///< [in] handle of the context object
5637-
ur_device_handle_t hDevice, ///< [in] handle of the device object
5641+
ur_device_handle_t hDevice, ///< [in][optional] handle of the device object
56385642
const ur_queue_native_properties_t *pProperties, ///< [in][optional] pointer to native queue properties struct
56395643
ur_queue_handle_t *phQueue ///< [out] pointer to the handle of the queue object created.
56405644
);
@@ -9822,6 +9826,7 @@ typedef struct ur_context_get_native_handle_params_t {
98229826
/// allowing the callback the ability to modify the parameter's value
98239827
typedef struct ur_context_create_with_native_handle_params_t {
98249828
ur_native_handle_t *phNativeContext;
9829+
ur_adapter_handle_t *phAdapter;
98259830
uint32_t *pnumDevices;
98269831
const ur_device_handle_t **pphDevices;
98279832
const ur_context_native_properties_t **ppProperties;

include/ur_ddi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ typedef ur_result_t(UR_APICALL *ur_pfnContextGetNativeHandle_t)(
135135
/// @brief Function-pointer for urContextCreateWithNativeHandle
136136
typedef ur_result_t(UR_APICALL *ur_pfnContextCreateWithNativeHandle_t)(
137137
ur_native_handle_t,
138+
ur_adapter_handle_t,
138139
uint32_t,
139140
const ur_device_handle_t *,
140141
const ur_context_native_properties_t *,

include/ur_print.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10668,6 +10668,12 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct
1066810668
ur::details::printPtr(os, reinterpret_cast<void *>(
1066910669
*(params->phNativeContext)));
1067010670

10671+
os << ", ";
10672+
os << ".hAdapter = ";
10673+
10674+
ur::details::printPtr(os,
10675+
*(params->phAdapter));
10676+
1067110677
os << ", ";
1067210678
os << ".numDevices = ";
1067310679

scripts/core/context.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,15 @@ params:
228228
name: hNativeContext
229229
desc: |
230230
[in][nocheck] the native handle of the context.
231+
- type: $x_adapter_handle_t
232+
name: hAdapter
233+
desc: "[in] handle of the adapter that owns the native handle"
231234
- type: uint32_t
232235
name: numDevices
233236
desc: "[in] number of devices associated with the context"
234237
- type: "const $x_device_handle_t*"
235238
name: phDevices
236-
desc: "[in][range(0, numDevices)] list of devices associated with the context"
239+
desc: "[in][optional][range(0, numDevices)] list of devices associated with the context"
237240
- type: "const $x_context_native_properties_t*"
238241
name: pProperties
239242
desc: "[in][optional] pointer to native context properties struct"

scripts/core/kernel.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ details:
513513
- "Creates runtime kernel handle from native driver kernel handle."
514514
- "The application may call this function from simultaneous threads for the same context."
515515
- "The implementation of this function should be thread-safe."
516+
- "The implementation may require a valid program handle to return the native kernel handle"
516517
params:
517518
- type: $x_native_handle_t
518519
name: hNativeKernel
@@ -523,7 +524,7 @@ params:
523524
desc: "[in] handle of the context object"
524525
- type: $x_program_handle_t
525526
name: hProgram
526-
desc: "[in] handle of the program associated with the kernel"
527+
desc: "[in][optional] handle of the program associated with the kernel"
527528
- type: "const $x_kernel_native_properties_t*"
528529
name: pProperties
529530
desc: "[in][optional] pointer to native kernel properties struct"
@@ -534,6 +535,8 @@ params:
534535
returns:
535536
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
536537
- "If the adapter has no underlying equivalent handle."
538+
- $X_RESULT_ERROR_INVALID_NULL_HANDLE:
539+
- "If `hProgram == NULL` and the implementation requires a valid program."
537540
--- #--------------------------------------------------------------------------
538541
type: function
539542
desc: "Get the suggested local work size for a kernel."

scripts/core/queue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ params:
286286
desc: "[in] handle of the context object"
287287
- type: $x_device_handle_t
288288
name: hDevice
289-
desc: "[in] handle of the device object"
289+
desc: "[in][optional] handle of the device object"
290290
- type: "const $x_queue_native_properties_t*"
291291
name: pProperties
292292
desc: "[in][optional] pointer to native queue properties struct"

source/adapters/cuda/context.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextGetNativeHandle(
143143

144144
UR_APIEXPORT ur_result_t UR_APICALL urContextCreateWithNativeHandle(
145145
[[maybe_unused]] ur_native_handle_t hNativeContext,
146+
[[maybe_unused]] ur_adapter_handle_t hAdapter,
146147
[[maybe_unused]] uint32_t numDevices,
147148
[[maybe_unused]] const ur_device_handle_t *phDevices,
148149
[[maybe_unused]] const ur_context_native_properties_t *pProperties,

source/adapters/hip/context.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextGetNativeHandle(
122122

123123
UR_APIEXPORT ur_result_t UR_APICALL urContextCreateWithNativeHandle(
124124
[[maybe_unused]] ur_native_handle_t hNativeContext,
125+
[[maybe_unused]] ur_adapter_handle_t hAdapter,
125126
[[maybe_unused]] uint32_t numDevices,
126127
[[maybe_unused]] const ur_device_handle_t *phDevices,
127128
[[maybe_unused]] const ur_context_native_properties_t *pProperties,

0 commit comments

Comments
 (0)