diff --git a/.github/workflows/multi_device.yml b/.github/workflows/multi_device.yml index 3be4d55e88..48a804bdf8 100644 --- a/.github/workflows/multi_device.yml +++ b/.github/workflows/multi_device.yml @@ -63,4 +63,4 @@ jobs: - name: Test adapters working-directory: ${{github.workspace}}/build - run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" -E "enqueue|kernel|integration|exp_command_buffer|exp_enqueue_native|exp_launch_properties|exp_usm_p2p" --timeout 180 + run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" -E "exp_command_buffer" --timeout 180 diff --git a/source/adapters/level_zero/CMakeLists.txt b/source/adapters/level_zero/CMakeLists.txt index 5e6d0ce18e..d700fbb2c3 100644 --- a/source/adapters/level_zero/CMakeLists.txt +++ b/source/adapters/level_zero/CMakeLists.txt @@ -136,6 +136,7 @@ if(UR_BUILD_ADAPTER_L0_V2) ${CMAKE_CURRENT_SOURCE_DIR}/program.cpp ${CMAKE_CURRENT_SOURCE_DIR}/helpers/kernel_helpers.cpp ${CMAKE_CURRENT_SOURCE_DIR}/helpers/memory_helpers.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/usm_p2p.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.cpp # v2-only sources ${CMAKE_CURRENT_SOURCE_DIR}/v2/command_list_cache.hpp diff --git a/source/adapters/level_zero/device.cpp b/source/adapters/level_zero/device.cpp index 866fd0e15f..60d3b918b8 100644 --- a/source/adapters/level_zero/device.cpp +++ b/source/adapters/level_zero/device.cpp @@ -186,7 +186,7 @@ uint64_t calculateGlobalMemSize(ur_device_handle_t Device) { } } }; - return Device->ZeGlobalMemSize.operator->()->value; + return Device->ZeGlobalMemSize.get().value; } ur_result_t urDeviceGetInfo( diff --git a/source/adapters/level_zero/kernel.cpp b/source/adapters/level_zero/kernel.cpp index 9c201eda88..da9152396a 100644 --- a/source/adapters/level_zero/kernel.cpp +++ b/source/adapters/level_zero/kernel.cpp @@ -726,7 +726,7 @@ ur_result_t urKernelGetInfo( return ReturnValue(ur_program_handle_t{Kernel->Program}); case UR_KERNEL_INFO_FUNCTION_NAME: try { - std::string &KernelName = *Kernel->ZeKernelName.operator->(); + std::string &KernelName = Kernel->ZeKernelName.get(); return ReturnValue(static_cast(KernelName.c_str())); } catch (const std::bad_alloc &) { return UR_RESULT_ERROR_OUT_OF_HOST_MEMORY; diff --git a/source/adapters/level_zero/v2/api.cpp b/source/adapters/level_zero/v2/api.cpp index 8515997f35..b5254ad68b 100644 --- a/source/adapters/level_zero/v2/api.cpp +++ b/source/adapters/level_zero/v2/api.cpp @@ -177,13 +177,6 @@ ur_result_t urPhysicalMemRelease(ur_physical_mem_handle_t hPhysicalMem) { return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } -ur_result_t urKernelGetInfo(ur_kernel_handle_t hKernel, - ur_kernel_info_t propName, size_t propSize, - void *pPropValue, size_t *pPropSizeRet) { - logger::error("{} function not implemented!", __FUNCTION__); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - ur_result_t urKernelSetArgSampler(ur_kernel_handle_t hKernel, uint32_t argIndex, const ur_kernel_arg_sampler_properties_t *pProperties, @@ -629,24 +622,4 @@ ur_result_t urUSMReleaseExp(ur_context_handle_t hContext, void *pMem) { return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } -ur_result_t urUsmP2PEnablePeerAccessExp(ur_device_handle_t commandDevice, - ur_device_handle_t peerDevice) { - logger::error("{} function not implemented!", __FUNCTION__); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -ur_result_t urUsmP2PDisablePeerAccessExp(ur_device_handle_t commandDevice, - ur_device_handle_t peerDevice) { - logger::error("{} function not implemented!", __FUNCTION__); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -ur_result_t urUsmP2PPeerAccessGetInfoExp(ur_device_handle_t commandDevice, - ur_device_handle_t peerDevice, - ur_exp_peer_info_t propName, - size_t propSize, void *pPropValue, - size_t *pPropSizeRet) { - logger::error("{} function not implemented!", __FUNCTION__); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} } // namespace ur::level_zero diff --git a/source/adapters/level_zero/v2/kernel.cpp b/source/adapters/level_zero/v2/kernel.cpp index 26f3123c29..2f3321e27a 100644 --- a/source/adapters/level_zero/v2/kernel.cpp +++ b/source/adapters/level_zero/v2/kernel.cpp @@ -98,17 +98,19 @@ ur_result_t ur_kernel_handle_t_::release() { void ur_kernel_handle_t_::completeInitialization() { // Cache kernel name. Should be the same for all devices assert(deviceKernels.size() > 0); - auto nonEmptyKernel = - std::find_if(deviceKernels.begin(), deviceKernels.end(), - [](const auto &kernel) { return kernel.has_value(); }); + nonEmptyKernel = + &std::find_if(deviceKernels.begin(), deviceKernels.end(), + [](const auto &kernel) { return kernel.has_value(); }) + ->value(); - zeKernelName.Compute = [kernel = - &nonEmptyKernel->value()](std::string &name) { + zeCommonProperties.Compute = [kernel = nonEmptyKernel]( + common_properties_t &props) { size_t size = 0; ZE_CALL_NOCHECK(zeKernelGetName, (kernel->hKernel.get(), &size, nullptr)); - name.resize(size); + props.name.resize(size); ZE_CALL_NOCHECK(zeKernelGetName, - (kernel->hKernel.get(), &size, name.data())); + (kernel->hKernel.get(), &size, props.name.data())); + props.numKernelArgs = kernel->zeKernelProperties->numKernelArgs; }; } @@ -142,8 +144,9 @@ ur_kernel_handle_t_::getZeHandle(ur_device_handle_t hDevice) { return deviceKernels[hDevice->Id.value()].value().hKernel.get(); } -const std::string &ur_kernel_handle_t_::getName() const { - return *zeKernelName.operator->(); +ur_kernel_handle_t_::common_properties_t +ur_kernel_handle_t_::getCommonProperties() const { + return zeCommonProperties.get(); } const ze_kernel_properties_t & @@ -154,10 +157,7 @@ ur_kernel_handle_t_::getProperties(ur_device_handle_t hDevice) const { assert(deviceKernels[hDevice->Id.value()].value().hKernel.get()); - return *deviceKernels[hDevice->Id.value()] - .value() - .zeKernelProperties. - operator->(); + return deviceKernels[hDevice->Id.value()].value().zeKernelProperties.get(); } ur_result_t ur_kernel_handle_t_::setArgValue( @@ -178,6 +178,10 @@ ur_result_t ur_kernel_handle_t_::setArgValue( pArgValue = nullptr; } + if (argIndex > zeCommonProperties->numKernelArgs - 1) { + return UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX; + } + std::scoped_lock guard(Mutex); for (auto &singleDeviceKernel : deviceKernels) { @@ -185,9 +189,15 @@ ur_result_t ur_kernel_handle_t_::setArgValue( continue; } - ZE2UR_CALL(zeKernelSetArgumentValue, - (singleDeviceKernel.value().hKernel.get(), argIndex, argSize, - pArgValue)); + auto zeResult = ZE_CALL_NOCHECK(zeKernelSetArgumentValue, + (singleDeviceKernel.value().hKernel.get(), + argIndex, argSize, pArgValue)); + + if (zeResult == ZE_RESULT_ERROR_INVALID_ARGUMENT) { + return UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE; + } else if (zeResult != ZE_RESULT_SUCCESS) { + return ze2urResult(zeResult); + } } return UR_RESULT_SUCCESS; } @@ -257,6 +267,17 @@ std::vector ur_kernel_handle_t_::getDevices() const { return devices; } +std::vector ur_kernel_handle_t_::getSourceAttributes() const { + uint32_t size; + ZE2UR_CALL_THROWS(zeKernelGetSourceAttributes, + (nonEmptyKernel->hKernel.get(), &size, nullptr)); + std::vector attributes(size); + char *dataPtr = attributes.data(); + ZE2UR_CALL_THROWS(zeKernelGetSourceAttributes, + (nonEmptyKernel->hKernel.get(), &size, &dataPtr)); + return attributes; +} + namespace ur::level_zero { ur_result_t urKernelCreate(ur_program_handle_t hProgram, const char *pKernelName, @@ -477,4 +498,40 @@ ur_result_t urKernelGetSubGroupInfo( } return UR_RESULT_SUCCESS; } + +ur_result_t urKernelGetInfo(ur_kernel_handle_t hKernel, + ur_kernel_info_t paramName, size_t propSize, + void *pKernelInfo, size_t *pPropSizeRet) { + + UrReturnHelper ReturnValue(propSize, pKernelInfo, pPropSizeRet); + + std::shared_lock Guard(hKernel->Mutex); + switch (paramName) { + case UR_KERNEL_INFO_CONTEXT: + return ReturnValue( + ur_context_handle_t{hKernel->getProgramHandle()->Context}); + case UR_KERNEL_INFO_PROGRAM: + return ReturnValue(ur_program_handle_t{hKernel->getProgramHandle()}); + case UR_KERNEL_INFO_FUNCTION_NAME: { + auto kernelName = hKernel->getCommonProperties().name; + return ReturnValue(static_cast(kernelName.c_str())); + } + case UR_KERNEL_INFO_NUM_REGS: + case UR_KERNEL_INFO_NUM_ARGS: + return ReturnValue(uint32_t{hKernel->getCommonProperties().numKernelArgs}); + case UR_KERNEL_INFO_REFERENCE_COUNT: + return ReturnValue(uint32_t{hKernel->RefCount.load()}); + case UR_KERNEL_INFO_ATTRIBUTES: { + auto attributes = hKernel->getSourceAttributes(); + return ReturnValue(static_cast(attributes.data())); + } + default: + logger::error( + "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", + paramName, logger::toHex(paramName)); + return UR_RESULT_ERROR_INVALID_VALUE; + } + + return UR_RESULT_SUCCESS; +} } // namespace ur::level_zero diff --git a/source/adapters/level_zero/v2/kernel.hpp b/source/adapters/level_zero/v2/kernel.hpp index 2d3a891826..7615674dc1 100644 --- a/source/adapters/level_zero/v2/kernel.hpp +++ b/source/adapters/level_zero/v2/kernel.hpp @@ -27,6 +27,11 @@ struct ur_single_device_kernel_t { struct ur_kernel_handle_t_ : _ur_object { private: public: + struct common_properties_t { + std::string name; + uint32_t numKernelArgs; + }; + ur_kernel_handle_t_(ur_program_handle_t hProgram, const char *kernelName); // From native handle @@ -44,7 +49,7 @@ struct ur_kernel_handle_t_ : _ur_object { std::vector getDevices() const; // Get name of the kernel. - const std::string &getName() const; + common_properties_t getCommonProperties() const; // Get properties of the kernel. const ze_kernel_properties_t &getProperties(ur_device_handle_t hDevice) const; @@ -64,6 +69,8 @@ struct ur_kernel_handle_t_ : _ur_object { ur_result_t setExecInfo(ur_kernel_exec_info_t propName, const void *pPropValue); + std::vector getSourceAttributes() const; + // Perform cleanup. ur_result_t release(); @@ -74,8 +81,11 @@ struct ur_kernel_handle_t_ : _ur_object { // Vector of ur_single_device_kernel_t indexed by device->Id std::vector> deviceKernels; - // Cache of the kernel name. - mutable ZeCache zeKernelName; + // Cache of the common kernel properties. + mutable ZeCache zeCommonProperties; void completeInitialization(); + + // pointer to any non-null kernel in deviceKernels + ur_single_device_kernel_t *nonEmptyKernel; }; diff --git a/source/ur/ur.hpp b/source/ur/ur.hpp index 0639a9d9be..7e53425000 100644 --- a/source/ur/ur.hpp +++ b/source/ur/ur.hpp @@ -179,11 +179,13 @@ template struct ZeCache : private T { ZeCache() : T{} {} - // Access to the fields of the original T data structure. - T *operator->() { + T &get() { std::call_once(Computed, Compute, static_cast(*this)); - return this; + return *this; } + + // Access to the fields of the original T data structure. + T *operator->() { return &get(); } }; // Helper for one-liner validation diff --git a/test/conformance/enqueue/enqueue_adapter_level_zero.match b/test/conformance/enqueue/enqueue_adapter_level_zero.match index 982468733c..5a9ce841b8 100644 --- a/test/conformance/enqueue/enqueue_adapter_level_zero.match +++ b/test/conformance/enqueue/enqueue_adapter_level_zero.match @@ -3,8 +3,6 @@ {{OPT}}urEnqueueKernelLaunchTest.InvalidKernelArgs/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ {{OPT}}urEnqueueKernelLaunchKernelWgSizeTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ {{OPT}}urEnqueueKernelLaunchKernelSubGroupTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -{{OPT}}urEnqueueKernelLaunchUSMLinkedList.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}__UsePoolEnabled -{{OPT}}urEnqueueKernelLaunchUSMLinkedList.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}__UsePoolDisabled {{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___copy_2d_3d {{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___copy_3d_2d {{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___write_non_zero_offsets_2D @@ -13,6 +11,7 @@ {{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___write_3d_with_offsets {{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___write_2d_3d {{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___write_3d_2d +{{OPT}}urEnqueueMemBufferMapMultiDeviceTest.* {{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___write_3d_with_offsets {{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___write_2d_3d {{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___write_3d_2d @@ -23,36 +22,38 @@ {{OPT}}urEnqueueMemImageReadTest.InvalidOrigin2D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ {{OPT}}urEnqueueMemImageReadTest.InvalidOrigin3D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ {{OPT}}urEnqueueEventsWaitMultiDeviceMTTest/* -urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependencies/* -urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependenciesBarrierOnly/* -urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependenciesLaunchOnly/* -urEnqueueEventsWaitWithBarrierOrderingTest.SuccessNonEventDependencies/* -urEnqueueEventsWaitWithBarrierTest.Success/* -urEnqueueMemBufferCopyRectTestWithParam.Success/* -urEnqueueMemBufferCopyTestWithParam.Success/* -urEnqueueMemBufferFillTest.Success/* -urEnqueueMemBufferFillTest.SuccessOffset/* -urEnqueueMemBufferFillTest.SuccessPartialFill/* -urEnqueueMemBufferMapTestWithParam.SuccesPinnedWrite/* -urEnqueueMemBufferMapTestWithParam.SuccessMultiMaps/* -urEnqueueMemBufferMapTestWithParam.SuccessOffset/* -urEnqueueMemBufferMapTestWithParam.SuccessPartialMap/* -urEnqueueMemBufferMapTestWithWriteFlagParam.SuccessWrite/* -urEnqueueMemBufferReadRectTestWithParam.Success/* -urEnqueueMemBufferWriteRectTestWithParam.Success/* -urEnqueueMemImageCopyTest.Success/* -urEnqueueMemImageCopyTest.SuccessPartialCopy/* -urEnqueueMemImageCopyTest.SuccessPartialCopyWithDstOffset/* -urEnqueueMemImageCopyTest.SuccessPartialCopyWithSrcOffset/* -urEnqueueMemImageReadTest.InvalidRegion1D/* -urEnqueueMemImageReadTest.InvalidRegion2D/* -urEnqueueMemImageReadTest.InvalidRegion3D/* -urEnqueueMemImageWriteTest.InvalidOrigin1D/* -urEnqueueMemImageWriteTest.InvalidOrigin2D/* -urEnqueueMemImageWriteTest.InvalidOrigin3D/* -urEnqueueMemImageWriteTest.InvalidRegion1D/* -urEnqueueMemImageWriteTest.InvalidRegion2D/* -urEnqueueMemImageWriteTest.InvalidRegion3D/* +{{OPT}}urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependencies/* +{{OPT}}urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependenciesBarrierOnly/* +{{OPT}}urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependenciesLaunchOnly/* +{{OPT}}urEnqueueEventsWaitWithBarrierOrderingTest.SuccessNonEventDependencies/* +{{OPT}}urEnqueueEventsWaitWithBarrierTest.Success/* +{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/* +{{OPT}}urEnqueueMemBufferCopyTestWithParam.Success/* +{{OPT}}urEnqueueMemBufferFillTest.Success/* +{{OPT}}urEnqueueMemBufferFillTest.SuccessOffset/* +{{OPT}}urEnqueueMemBufferFillTest.SuccessPartialFill/* +{{OPT}}urEnqueueMemBufferMapTestWithParam.SuccesPinnedWrite/* +{{OPT}}urEnqueueMemBufferMapTestWithParam.SuccessMultiMaps/* +{{OPT}}urEnqueueMemBufferMapTestWithParam.SuccessRead/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___Intel_R__Data_Center_GPU_Max* +{{OPT}}urEnqueueMemBufferMapTestWithParam.SuccessOffset/* +{{OPT}}urEnqueueMemBufferMapTestWithParam.SuccessPartialMap/* +{{OPT}}urEnqueueMemBufferMapTestWithWriteFlagParam.SuccessWrite/* +{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/* +{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/* +{{OPT}}urEnqueueMemImageCopyTest.Success/* +{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopy/* +{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithDstOffset/* +{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithSrcOffset/* +{{OPT}}urEnqueueMemImageReadTest.InvalidRegion1D/* +{{OPT}}urEnqueueMemImageReadTest.InvalidRegion2D/* +{{OPT}}urEnqueueMemImageReadTest.InvalidRegion3D/* +{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin1D/* +{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin2D/* +{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin3D/* +{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion1D/* +{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion2D/* +{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion3D/* +{{OPT}}urEnqueueKernelLaunchMultiDeviceTest.KernelLaunchReadDifferentQueues/* urEnqueueReadHostPipeTest.InvalidEventWaitList/* urEnqueueReadHostPipeTest.InvalidNullHandleProgram/* urEnqueueReadHostPipeTest.InvalidNullHandleQueue/* @@ -60,9 +61,9 @@ urEnqueueReadHostPipeTest.InvalidNullPointerBuffer/* urEnqueueReadHostPipeTest.InvalidNullPointerPipeSymbol/* urEnqueueUSMAdviseTest.InvalidSizeTooLarge/* urEnqueueUSMFill2DNegativeTest.OutOfBounds/* -urEnqueueUSMMemcpyTest.Blocking/* -urEnqueueUSMMemcpyTest.BlockingWithEvent/* -urEnqueueUSMMemcpyTest.WaitForDependencies/* +{{OPT}}urEnqueueUSMMemcpyTest.Blocking/* +{{OPT}}urEnqueueUSMMemcpyTest.BlockingWithEvent/* +{{OPT}}urEnqueueUSMMemcpyTest.WaitForDependencies/* urEnqueueUSMPrefetchTest.InvalidSizeTooLarge/* urEnqueueWriteHostPipeTest.InvalidEventWaitList/* urEnqueueWriteHostPipeTest.InvalidNullHandleProgram/* diff --git a/test/conformance/enqueue/enqueue_adapter_level_zero_v2.match b/test/conformance/enqueue/enqueue_adapter_level_zero_v2.match index 65a7754f6c..c72bf51398 100644 --- a/test/conformance/enqueue/enqueue_adapter_level_zero_v2.match +++ b/test/conformance/enqueue/enqueue_adapter_level_zero_v2.match @@ -2,12 +2,11 @@ urEnqueueKernelLaunchTest.InvalidKernelArgs/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urEnqueueKernelLaunchKernelWgSizeTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urEnqueueKernelLaunchWithVirtualMemory.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueKernelLaunchUSMLinkedList.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UsePoolEnabled -urEnqueueKernelLaunchUSMLinkedList.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UsePoolDisabled {{OPT}}urEnqueueKernelLaunchIncrementTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UseEventsEnabled {{OPT}}urEnqueueKernelLaunchIncrementTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UseEventsDisabled {{OPT}}urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/UseEventsNoQueuePerThread {{OPT}}urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/NoUseEventsNoQueuePerThread +{{OPT}}urEnqueueKernelLaunchKernelSubGroupTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ {{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___copy_whole_buffer_2D {{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___copy_non_zero_offsets_2D {{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___copy_different_buffer_sizes_2D @@ -35,59 +34,60 @@ urEnqueueKernelLaunchUSMLinkedList.Success/Intel_R__oneAPI_Unified_Runtime_over_ {{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___write_3d_with_offsets {{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___write_2d_3d {{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___write_3d_2d -urEnqueueMemImageCopyTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D -urEnqueueMemImageCopyTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D -urEnqueueMemImageCopyTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D -urEnqueueMemImageCopyTest.SuccessPartialCopy/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D -urEnqueueMemImageCopyTest.SuccessPartialCopy/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D -urEnqueueMemImageCopyTest.SuccessPartialCopy/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D -urEnqueueMemImageCopyTest.SuccessPartialCopyWithSrcOffset/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D -urEnqueueMemImageCopyTest.SuccessPartialCopyWithSrcOffset/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D -urEnqueueMemImageCopyTest.SuccessPartialCopyWithSrcOffset/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D -urEnqueueMemImageCopyTest.SuccessPartialCopyWithDstOffset/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D -urEnqueueMemImageCopyTest.SuccessPartialCopyWithDstOffset/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D -urEnqueueMemImageCopyTest.SuccessPartialCopyWithDstOffset/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D -urEnqueueMemImageCopyTest.InvalidNullHandleQueue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D -urEnqueueMemImageCopyTest.InvalidNullHandleQueue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D -urEnqueueMemImageCopyTest.InvalidNullHandleQueue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D -urEnqueueMemImageCopyTest.InvalidNullHandleImageSrc/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D -urEnqueueMemImageCopyTest.InvalidNullHandleImageSrc/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D -urEnqueueMemImageCopyTest.InvalidNullHandleImageSrc/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D -urEnqueueMemImageCopyTest.InvalidNullHandleImageDst/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D -urEnqueueMemImageCopyTest.InvalidNullHandleImageDst/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D -urEnqueueMemImageCopyTest.InvalidNullHandleImageDst/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D -urEnqueueMemImageCopyTest.InvalidNullPtrEventWaitList/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D -urEnqueueMemImageCopyTest.InvalidNullPtrEventWaitList/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D -urEnqueueMemImageCopyTest.InvalidNullPtrEventWaitList/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D -urEnqueueMemImageCopyTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D -urEnqueueMemImageCopyTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D -urEnqueueMemImageCopyTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D -urEnqueueMemImageReadTest.Success1D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageReadTest.Success2D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageReadTest.Success3D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageReadTest.InvalidNullHandleQueue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageReadTest.InvalidNullHandleImage/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageReadTest.InvalidNullPointerDst/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageReadTest.InvalidNullPtrEventWaitList/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageReadTest.InvalidOrigin1D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageReadTest.InvalidOrigin2D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageReadTest.InvalidOrigin3D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageReadTest.InvalidRegion1D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageReadTest.InvalidRegion2D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageReadTest.InvalidRegion3D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageWriteTest.Success1D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageWriteTest.Success2D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageWriteTest.Success3D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageWriteTest.InvalidNullHandleQueue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageWriteTest.InvalidNullHandleImage/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageWriteTest.InvalidNullPointerSrc/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageWriteTest.InvalidNullPtrEventWaitList/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageWriteTest.InvalidOrigin1D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageWriteTest.InvalidOrigin2D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageWriteTest.InvalidOrigin3D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageWriteTest.InvalidRegion1D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageWriteTest.InvalidRegion2D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urEnqueueMemImageWriteTest.InvalidRegion3D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageCopyTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D +{{OPT}}urEnqueueMemImageCopyTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D +{{OPT}}urEnqueueMemImageCopyTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D +{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopy/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D +{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopy/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D +{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopy/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D +{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithSrcOffset/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D +{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithSrcOffset/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D +{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithSrcOffset/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D +{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithDstOffset/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D +{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithDstOffset/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D +{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithDstOffset/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D +{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleQueue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D +{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleQueue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D +{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleQueue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D +{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleImageSrc/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D +{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleImageSrc/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D +{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleImageSrc/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D +{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleImageDst/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D +{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleImageDst/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D +{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleImageDst/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D +{{OPT}}urEnqueueMemImageCopyTest.InvalidNullPtrEventWaitList/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D +{{OPT}}urEnqueueMemImageCopyTest.InvalidNullPtrEventWaitList/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D +{{OPT}}urEnqueueMemImageCopyTest.InvalidNullPtrEventWaitList/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D +{{OPT}}urEnqueueMemImageCopyTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1D +{{OPT}}urEnqueueMemImageCopyTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2D +{{OPT}}urEnqueueMemImageCopyTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3D +{{OPT}}urEnqueueMemImageReadTest.Success1D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageReadTest.Success2D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageReadTest.Success3D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageReadTest.InvalidNullHandleQueue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageReadTest.InvalidNullHandleImage/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageReadTest.InvalidNullPointerDst/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageReadTest.InvalidNullPtrEventWaitList/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin1D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin2D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin3D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageReadTest.InvalidRegion1D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageReadTest.InvalidRegion2D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageReadTest.InvalidRegion3D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageWriteTest.Success1D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageWriteTest.Success2D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageWriteTest.Success3D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageWriteTest.InvalidNullHandleQueue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageWriteTest.InvalidNullHandleImage/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageWriteTest.InvalidNullPointerSrc/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageWriteTest.InvalidNullPtrEventWaitList/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin1D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin2D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin3D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion1D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion2D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion3D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +{{OPT}}urEnqueueKernelLaunchMultiDeviceTest.KernelLaunchReadDifferentQueues/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urEnqueueUSMFill2DNegativeTest.OutOfBounds/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urEnqueueUSMAdviseTest.InvalidSizeTooLarge/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urEnqueueUSMPrefetchTest.InvalidSizeTooLarge/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ diff --git a/test/conformance/enqueue/urEnqueueKernelLaunch.cpp b/test/conformance/enqueue/urEnqueueKernelLaunch.cpp index aa1c436fa8..202c3082ad 100644 --- a/test/conformance/enqueue/urEnqueueKernelLaunch.cpp +++ b/test/conformance/enqueue/urEnqueueKernelLaunch.cpp @@ -139,8 +139,9 @@ TEST_P(urEnqueueKernelLaunchTest, InvalidKernelArgs) { nullptr)); if (backend == UR_PLATFORM_BACKEND_CUDA || - backend == UR_PLATFORM_BACKEND_HIP) { - GTEST_FAIL() << "AMD and Nvidia can't check kernel arguments."; + backend == UR_PLATFORM_BACKEND_HIP || + backend == UR_PLATFORM_BACKEND_LEVEL_ZERO) { + GTEST_FAIL() << "AMD, L0 and Nvidia can't check kernel arguments."; } // Enqueue kernel without setting any args @@ -471,6 +472,8 @@ struct urEnqueueKernelLaunchMultiDeviceTest : public urEnqueueKernelLaunchTest { }; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueKernelLaunchMultiDeviceTest); +// TODO: rewrite this test, right now it only works for a single queue +// (the context is only created for one device) TEST_P(urEnqueueKernelLaunchMultiDeviceTest, KernelLaunchReadDifferentQueues) { ur_mem_handle_t buffer = nullptr; AddBuffer1DArg(sizeof(val) * global_size, &buffer); @@ -561,8 +564,8 @@ TEST_P(urEnqueueKernelLaunchUSMLinkedList, Success) { } // Build linked list with USM allocations - ASSERT_SUCCESS(urUSMSharedAlloc(context, device, nullptr, pool, - sizeof(Node), + ur_usm_desc_t desc{UR_STRUCTURE_TYPE_USM_DESC, nullptr, 0, alignof(Node)}; + ASSERT_SUCCESS(urUSMSharedAlloc(context, device, &desc, pool, sizeof(Node), reinterpret_cast(&list_head))); ASSERT_NE(list_head, nullptr); Node *list_cur = list_head; @@ -570,7 +573,7 @@ TEST_P(urEnqueueKernelLaunchUSMLinkedList, Success) { list_cur->num = i * 2; if (i < num_nodes - 1) { ASSERT_SUCCESS( - urUSMSharedAlloc(context, device, nullptr, pool, sizeof(Node), + urUSMSharedAlloc(context, device, &desc, pool, sizeof(Node), reinterpret_cast(&list_cur->next))); ASSERT_NE(list_cur->next, nullptr); } else { @@ -579,6 +582,11 @@ TEST_P(urEnqueueKernelLaunchUSMLinkedList, Success) { list_cur = list_cur->next; } + ur_bool_t indirect = true; + ASSERT_SUCCESS(urKernelSetExecInfo(kernel, + UR_KERNEL_EXEC_INFO_USM_INDIRECT_ACCESS, + sizeof(indirect), nullptr, &indirect)); + // Run kernel which will iterate the list and modify the values ASSERT_SUCCESS(urKernelSetArgPointer(kernel, 0, nullptr, list_head)); ASSERT_SUCCESS(urEnqueueKernelLaunch(queue, kernel, 1, &global_offset, diff --git a/test/conformance/enqueue/urEnqueueMemImageCopy.cpp b/test/conformance/enqueue/urEnqueueMemImageCopy.cpp index 293297589a..715fd66773 100644 --- a/test/conformance/enqueue/urEnqueueMemImageCopy.cpp +++ b/test/conformance/enqueue/urEnqueueMemImageCopy.cpp @@ -12,6 +12,15 @@ struct urEnqueueMemImageCopyTest }; void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::SetUp()); + + ur_bool_t imageSupported; + ASSERT_SUCCESS( + urDeviceGetInfo(this->device, UR_DEVICE_INFO_IMAGE_SUPPORTED, + sizeof(ur_bool_t), &imageSupported, nullptr)); + if (!imageSupported) { + GTEST_SKIP(); + } + type = getParam(); size = (type == UR_MEM_TYPE_IMAGE1D) ? ur_rect_region_t{width, 1, 1} : (type == UR_MEM_TYPE_IMAGE2D) diff --git a/test/conformance/event/urEventWait.cpp b/test/conformance/event/urEventWait.cpp index c226c497a4..1fbfaa09c3 100644 --- a/test/conformance/event/urEventWait.cpp +++ b/test/conformance/event/urEventWait.cpp @@ -8,9 +8,9 @@ struct urEventWaitTest : uur::urQueueTest { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); - ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_WRITE_ONLY, size, - nullptr, &src_buffer)); ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_READ_ONLY, size, + nullptr, &src_buffer)); + ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_WRITE_ONLY, size, nullptr, &dst_buffer)); input.assign(count, 42); ASSERT_SUCCESS(urEnqueueMemBufferWrite(queue, src_buffer, false, 0, diff --git a/test/conformance/kernel/kernel_adapter_level_zero_v2.match b/test/conformance/kernel/kernel_adapter_level_zero_v2.match index 8f431b3617..cf83e73ff3 100644 --- a/test/conformance/kernel/kernel_adapter_level_zero_v2.match +++ b/test/conformance/kernel/kernel_adapter_level_zero_v2.match @@ -1,63 +1,4 @@ {{NONDETERMINISTIC}} -urKernelGetInfoTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_FUNCTION_NAME -urKernelGetInfoTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_NUM_ARGS -urKernelGetInfoTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_REFERENCE_COUNT -urKernelGetInfoTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_CONTEXT -urKernelGetInfoTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_PROGRAM -urKernelGetInfoTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_ATTRIBUTES -urKernelGetInfoTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_NUM_REGS -urKernelGetInfoTest.InvalidSizeZero/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_FUNCTION_NAME -urKernelGetInfoTest.InvalidSizeZero/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_NUM_ARGS -urKernelGetInfoTest.InvalidSizeZero/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_REFERENCE_COUNT -urKernelGetInfoTest.InvalidSizeZero/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_CONTEXT -urKernelGetInfoTest.InvalidSizeZero/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_PROGRAM -urKernelGetInfoTest.InvalidSizeZero/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_ATTRIBUTES -urKernelGetInfoTest.InvalidSizeZero/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_NUM_REGS -urKernelGetInfoTest.InvalidSizeSmall/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_FUNCTION_NAME -urKernelGetInfoTest.InvalidSizeSmall/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_NUM_ARGS -urKernelGetInfoTest.InvalidSizeSmall/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_REFERENCE_COUNT -urKernelGetInfoTest.InvalidSizeSmall/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_CONTEXT -urKernelGetInfoTest.InvalidSizeSmall/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_PROGRAM -urKernelGetInfoTest.InvalidSizeSmall/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_ATTRIBUTES -urKernelGetInfoTest.InvalidSizeSmall/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_NUM_REGS -urKernelGetInfoTest.InvalidNullPointerPropValue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_FUNCTION_NAME -urKernelGetInfoTest.InvalidNullPointerPropValue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_NUM_ARGS -urKernelGetInfoTest.InvalidNullPointerPropValue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_REFERENCE_COUNT -urKernelGetInfoTest.InvalidNullPointerPropValue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_CONTEXT -urKernelGetInfoTest.InvalidNullPointerPropValue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_PROGRAM -urKernelGetInfoTest.InvalidNullPointerPropValue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_ATTRIBUTES -urKernelGetInfoTest.InvalidNullPointerPropValue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_KERNEL_INFO_NUM_REGS -urKernelGetInfoSingleTest.KernelNameCorrect/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urKernelGetInfoSingleTest.KernelContextCorrect/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urKernelSetArgLocalTest.InvalidKernelArgumentIndex/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urKernelSetArgMemObjTest.InvalidKernelArgumentIndex/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urKernelSetArgPointerNegativeTest.InvalidKernelArgumentIndex/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_NEAREST -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_LINEAR -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_NEAREST -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_LINEAR -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_NEAREST -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_LINEAR -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_NEAREST -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_LINEAR -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_NEAREST -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_LINEAR -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_NEAREST -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_LINEAR -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST -urKernelSetArgSamplerTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR -urKernelSetArgSamplerTest.SuccessWithProps/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urKernelSetArgSamplerTest.InvalidNullHandleKernel/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urKernelSetArgSamplerTest.InvalidNullHandleArgValue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urKernelSetArgSamplerTest.InvalidKernelArgumentIndex/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urKernelSetArgValueTest.InvalidKernelArgumentIndex/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urKernelSetArgValueTest.InvalidKernelArgumentSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urKernelSetExecInfoTest.SuccessIndirectAccess/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urKernelSetExecInfoUSMPointersTest.SuccessHost/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urKernelSetExecInfoUSMPointersTest.SuccessDevice/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ diff --git a/test/conformance/kernel/urKernelSetArgSampler.cpp b/test/conformance/kernel/urKernelSetArgSampler.cpp index 824619874e..83a65613e5 100644 --- a/test/conformance/kernel/urKernelSetArgSampler.cpp +++ b/test/conformance/kernel/urKernelSetArgSampler.cpp @@ -8,12 +8,6 @@ struct urKernelSetArgSamplerTestWithParam : uur::urBaseKernelTestWithParam { void SetUp() { - program_name = "image_copy"; - UUR_RETURN_ON_FATAL_FAILURE( - uur::urBaseKernelTestWithParam::SetUp()); - UUR_RETURN_ON_FATAL_FAILURE( - uur::urBaseKernelTestWithParam::Build()); - const auto param = getParam(); const auto normalized = std::get<0>(param); const auto addr_mode = std::get<1>(param); @@ -26,7 +20,21 @@ struct urKernelSetArgSamplerTestWithParam addr_mode, /* addressingMode */ filter_mode /* filterMode */ }; - ASSERT_SUCCESS(urSamplerCreate(context, &sampler_desc, &sampler)); + + program_name = "image_copy"; + UUR_RETURN_ON_FATAL_FAILURE( + uur::urBaseKernelTestWithParam::SetUp()); + + auto ret = urSamplerCreate(context, &sampler_desc, &sampler); + if (ret == UR_RESULT_ERROR_UNSUPPORTED_FEATURE || + ret == UR_RESULT_ERROR_UNINITIALIZED) { + GTEST_SKIP() << "urSamplerCreate not supported"; + } else { + ASSERT_SUCCESS(ret); + } + + UUR_RETURN_ON_FATAL_FAILURE( + uur::urBaseKernelTestWithParam::Build()); } void TearDown() { @@ -62,7 +70,7 @@ struct urKernelSetArgSamplerTest : uur::urBaseKernelTest { void SetUp() { program_name = "image_copy"; UUR_RETURN_ON_FATAL_FAILURE(urBaseKernelTest::SetUp()); - Build(); + ur_sampler_desc_t sampler_desc = { UR_STRUCTURE_TYPE_SAMPLER_DESC, /* sType */ nullptr, /* pNext */ @@ -70,7 +78,16 @@ struct urKernelSetArgSamplerTest : uur::urBaseKernelTest { UR_SAMPLER_ADDRESSING_MODE_CLAMP, /* addressingMode */ UR_SAMPLER_FILTER_MODE_NEAREST /* filterMode */ }; - ASSERT_SUCCESS(urSamplerCreate(context, &sampler_desc, &sampler)); + + auto ret = urSamplerCreate(context, &sampler_desc, &sampler); + if (ret == UR_RESULT_ERROR_UNSUPPORTED_FEATURE || + ret == UR_RESULT_ERROR_UNINITIALIZED) { + GTEST_SKIP() << "urSamplerCreate not supported"; + } else { + ASSERT_SUCCESS(ret); + } + + Build(); } void TearDown() {