diff --git a/.github/workflows/build-hw-reusable.yml b/.github/workflows/build-hw-reusable.yml index 3c791db161..5492f04e29 100644 --- a/.github/workflows/build-hw-reusable.yml +++ b/.github/workflows/build-hw-reusable.yml @@ -110,11 +110,11 @@ jobs: # This is to check that install command does not fail run: cmake --install ${{github.workspace}}/build - - name: Test adapter specific - working-directory: ${{github.workspace}}/build - run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180 - # Don't run adapter specific tests when building multiple adapters - if: ${{ matrix.adapter.other_name == '' }} + # - name: Test adapter specific + # working-directory: ${{github.workspace}}/build + # run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180 + # # Don't run adapter specific tests when building multiple adapters + # if: ${{ matrix.adapter.other_name == '' }} - name: Test adapters working-directory: ${{github.workspace}}/build diff --git a/include/ur_api.h b/include/ur_api.h index 60f220f4a2..4cd6c7f020 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -1493,232 +1493,231 @@ urDeviceGetSelected( /////////////////////////////////////////////////////////////////////////////// /// @brief Supported device info typedef enum ur_device_info_t { - UR_DEVICE_INFO_TYPE = 0, ///< [::ur_device_type_t] type of the device - UR_DEVICE_INFO_VENDOR_ID = 1, ///< [uint32_t] vendor Id of the device - UR_DEVICE_INFO_DEVICE_ID = 2, ///< [uint32_t][optional-query] Id of the device - UR_DEVICE_INFO_MAX_COMPUTE_UNITS = 3, ///< [uint32_t] the number of compute units - UR_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS = 4, ///< [uint32_t] max work item dimensions - UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES = 5, ///< [size_t[]] return an array of max work item sizes - UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE = 6, ///< [size_t] max work group size - UR_DEVICE_INFO_SINGLE_FP_CONFIG = 7, ///< [::ur_device_fp_capability_flags_t] single precision floating point - ///< capability - UR_DEVICE_INFO_HALF_FP_CONFIG = 8, ///< [::ur_device_fp_capability_flags_t] half precision floating point - ///< capability - UR_DEVICE_INFO_DOUBLE_FP_CONFIG = 9, ///< [::ur_device_fp_capability_flags_t] double precision floating point - ///< capability - UR_DEVICE_INFO_QUEUE_PROPERTIES = 10, ///< [::ur_queue_flags_t] command queue properties supported by the device - UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_CHAR = 11, ///< [uint32_t] preferred vector width for char - UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_SHORT = 12, ///< [uint32_t] preferred vector width for short - UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT = 13, ///< [uint32_t] preferred vector width for int - UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG = 14, ///< [uint32_t] preferred vector width for long - UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT = 15, ///< [uint32_t] preferred vector width for float - UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_DOUBLE = 16, ///< [uint32_t] preferred vector width for double - UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF = 17, ///< [uint32_t] preferred vector width for half float - UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR = 18, ///< [uint32_t] native vector width for char - UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT = 19, ///< [uint32_t] native vector width for short - UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT = 20, ///< [uint32_t] native vector width for int - UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG = 21, ///< [uint32_t] native vector width for long - UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT = 22, ///< [uint32_t] native vector width for float - UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE = 23, ///< [uint32_t] native vector width for double - UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF = 24, ///< [uint32_t] native vector width for half float - UR_DEVICE_INFO_MAX_CLOCK_FREQUENCY = 25, ///< [uint32_t] max clock frequency in MHz - UR_DEVICE_INFO_MEMORY_CLOCK_RATE = 26, ///< [uint32_t][optional-query] memory clock frequency in MHz - UR_DEVICE_INFO_ADDRESS_BITS = 27, ///< [uint32_t] address bits - UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE = 28, ///< [uint64_t] max memory allocation size - UR_DEVICE_INFO_IMAGE_SUPPORTED = 29, ///< [::ur_bool_t] images are supported - UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS = 30, ///< [uint32_t] max number of image objects arguments of a kernel declared - ///< with the read_only qualifier - UR_DEVICE_INFO_MAX_WRITE_IMAGE_ARGS = 31, ///< [uint32_t] max number of image objects arguments of a kernel declared - ///< with the write_only qualifier - UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS = 32, ///< [uint32_t] max number of image objects arguments of a kernel declared - ///< with the read_write qualifier - UR_DEVICE_INFO_IMAGE2D_MAX_WIDTH = 33, ///< [size_t] max width of Image2D object - UR_DEVICE_INFO_IMAGE2D_MAX_HEIGHT = 34, ///< [size_t] max height of Image2D object - UR_DEVICE_INFO_IMAGE3D_MAX_WIDTH = 35, ///< [size_t] max width of Image3D object - UR_DEVICE_INFO_IMAGE3D_MAX_HEIGHT = 36, ///< [size_t] max height of Image3D object - UR_DEVICE_INFO_IMAGE3D_MAX_DEPTH = 37, ///< [size_t] max depth of Image3D object - UR_DEVICE_INFO_IMAGE_MAX_BUFFER_SIZE = 38, ///< [size_t] max image buffer size - UR_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE = 39, ///< [size_t] max image array size - UR_DEVICE_INFO_MAX_SAMPLERS = 40, ///< [uint32_t] max number of samplers that can be used in a kernel - UR_DEVICE_INFO_MAX_PARAMETER_SIZE = 41, ///< [size_t] max size in bytes of all arguments passed to a kernel - UR_DEVICE_INFO_MEM_BASE_ADDR_ALIGN = 42, ///< [uint32_t] memory base address alignment - UR_DEVICE_INFO_GLOBAL_MEM_CACHE_TYPE = 43, ///< [::ur_device_mem_cache_type_t] global memory cache type - UR_DEVICE_INFO_GLOBAL_MEM_CACHELINE_SIZE = 44, ///< [uint32_t] global memory cache line size in bytes - UR_DEVICE_INFO_GLOBAL_MEM_CACHE_SIZE = 45, ///< [uint64_t] size of global memory cache in bytes - UR_DEVICE_INFO_GLOBAL_MEM_SIZE = 46, ///< [uint64_t] size of global memory in bytes - UR_DEVICE_INFO_GLOBAL_MEM_FREE = 47, ///< [uint64_t][optional-query] size of global memory which is free in - ///< bytes - UR_DEVICE_INFO_MAX_CONSTANT_BUFFER_SIZE = 48, ///< [uint64_t] max constant buffer size in bytes - UR_DEVICE_INFO_MAX_CONSTANT_ARGS = 49, ///< [uint32_t] max number of __const declared arguments in a kernel - UR_DEVICE_INFO_LOCAL_MEM_TYPE = 50, ///< [::ur_device_local_mem_type_t] local memory type - UR_DEVICE_INFO_LOCAL_MEM_SIZE = 51, ///< [uint64_t] local memory size in bytes - UR_DEVICE_INFO_ERROR_CORRECTION_SUPPORT = 52, ///< [::ur_bool_t] support error correction to global and local memory - UR_DEVICE_INFO_HOST_UNIFIED_MEMORY = 53, ///< [::ur_bool_t] unified host device memory - UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION = 54, ///< [size_t] profiling timer resolution in nanoseconds - UR_DEVICE_INFO_ENDIAN_LITTLE = 55, ///< [::ur_bool_t] little endian byte order - UR_DEVICE_INFO_AVAILABLE = 56, ///< [::ur_bool_t] device is available - UR_DEVICE_INFO_COMPILER_AVAILABLE = 57, ///< [::ur_bool_t] device compiler is available - UR_DEVICE_INFO_LINKER_AVAILABLE = 58, ///< [::ur_bool_t] device linker is available - UR_DEVICE_INFO_EXECUTION_CAPABILITIES = 59, ///< [::ur_device_exec_capability_flags_t] device kernel execution - ///< capability bit-field - UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES = 60, ///< [::ur_queue_flags_t] device command queue property bit-field - UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES = 61, ///< [::ur_queue_flags_t] host queue property bit-field - UR_DEVICE_INFO_BUILT_IN_KERNELS = 62, ///< [char[]] a semi-colon separated list of built-in kernels - UR_DEVICE_INFO_PLATFORM = 63, ///< [::ur_platform_handle_t] the platform associated with the device - UR_DEVICE_INFO_REFERENCE_COUNT = 64, ///< [uint32_t] Reference count of the device object. - ///< The reference count returned should be considered immediately stale. - ///< It is unsuitable for general use in applications. This feature is - ///< provided for identifying memory leaks. - UR_DEVICE_INFO_IL_VERSION = 65, ///< [char[]] IL version - UR_DEVICE_INFO_NAME = 66, ///< [char[]] Device name - UR_DEVICE_INFO_VENDOR = 67, ///< [char[]] Device vendor - UR_DEVICE_INFO_DRIVER_VERSION = 68, ///< [char[]] Driver version - UR_DEVICE_INFO_PROFILE = 69, ///< [char[]] Device profile - UR_DEVICE_INFO_VERSION = 70, ///< [char[]] Device version - UR_DEVICE_INFO_BACKEND_RUNTIME_VERSION = 71, ///< [char[]] Version of backend runtime - UR_DEVICE_INFO_EXTENSIONS = 72, ///< [char[]] Return a space separated list of extension names - UR_DEVICE_INFO_PRINTF_BUFFER_SIZE = 73, ///< [size_t] Maximum size in bytes of internal printf buffer - UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC = 74, ///< [::ur_bool_t] prefer user synchronization when sharing object with - ///< other API - UR_DEVICE_INFO_PARENT_DEVICE = 75, ///< [::ur_device_handle_t] return parent device handle - UR_DEVICE_INFO_SUPPORTED_PARTITIONS = 76, ///< [::ur_device_partition_t[]] Returns an array of partition types - ///< supported by the device - UR_DEVICE_INFO_PARTITION_MAX_SUB_DEVICES = 77, ///< [uint32_t] maximum number of sub-devices when the device is - ///< partitioned - UR_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN = 78, ///< [::ur_device_affinity_domain_flags_t] Returns a bit-field of the - ///< supported affinity domains for partitioning. - ///< If the device does not support any affinity domains, then 0 will be returned. - UR_DEVICE_INFO_PARTITION_TYPE = 79, ///< [::ur_device_partition_property_t[]] return an array of - ///< ::ur_device_partition_property_t for properties specified in - ///< ::urDevicePartition - UR_DEVICE_INFO_MAX_NUM_SUB_GROUPS = 80, ///< [uint32_t] max number of sub groups - UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS = 81, ///< [::ur_bool_t] support sub group independent forward progress - UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL = 82, ///< [uint32_t[]] return an array of supported sub group sizes - UR_DEVICE_INFO_USM_HOST_SUPPORT = 83, ///< [::ur_device_usm_access_capability_flags_t] support USM host memory - ///< access - UR_DEVICE_INFO_USM_DEVICE_SUPPORT = 84, ///< [::ur_device_usm_access_capability_flags_t] support USM device memory - ///< access - UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT = 85, ///< [::ur_device_usm_access_capability_flags_t] support USM single device - ///< shared memory access - UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT = 86, ///< [::ur_device_usm_access_capability_flags_t] support USM cross device - ///< shared memory access - UR_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT = 87, ///< [::ur_device_usm_access_capability_flags_t] support USM system wide - ///< shared memory access - UR_DEVICE_INFO_UUID = 88, ///< [uint8_t[]][optional-query] return device UUID - UR_DEVICE_INFO_PCI_ADDRESS = 89, ///< [char[]][optional-query] return device PCI address - UR_DEVICE_INFO_GPU_EU_COUNT = 90, ///< [uint32_t][optional-query] return Intel GPU EU count - UR_DEVICE_INFO_GPU_EU_SIMD_WIDTH = 91, ///< [uint32_t][optional-query] return Intel GPU EU SIMD width - UR_DEVICE_INFO_GPU_EU_SLICES = 92, ///< [uint32_t][optional-query] return Intel GPU number of slices - UR_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE = 93, ///< [uint32_t][optional-query] return Intel GPU EU count per subslice - UR_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE = 94, ///< [uint32_t][optional-query] return Intel GPU number of subslices per - ///< slice - UR_DEVICE_INFO_GPU_HW_THREADS_PER_EU = 95, ///< [uint32_t][optional-query] return Intel GPU number of threads per EU - UR_DEVICE_INFO_MAX_MEMORY_BANDWIDTH = 96, ///< [uint32_t][optional-query] return max memory bandwidth in Mb/s - UR_DEVICE_INFO_IMAGE_SRGB = 97, ///< [::ur_bool_t] device supports sRGB images - UR_DEVICE_INFO_BUILD_ON_SUBDEVICE = 98, ///< [::ur_bool_t] Return true if sub-device should do its own program - ///< build - UR_DEVICE_INFO_ATOMIC_64 = 99, ///< [::ur_bool_t] support 64 bit atomics - UR_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES = 100, ///< [::ur_memory_order_capability_flags_t] return a bit-field of atomic - ///< memory order capabilities - UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES = 101, ///< [::ur_memory_scope_capability_flags_t] return a bit-field of atomic - ///< memory scope capabilities - UR_DEVICE_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES = 102, ///< [::ur_memory_order_capability_flags_t] return a bit-field of atomic - ///< memory fence order capabilities - UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES = 103, ///< [::ur_memory_scope_capability_flags_t] return a bit-field of atomic - ///< memory fence scope capabilities - UR_DEVICE_INFO_BFLOAT16 = 104, ///< [::ur_bool_t] support for bfloat16 - UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES = 105, ///< [uint32_t] Returns 1 if the device doesn't have a notion of a - ///< queue index. Otherwise, returns the number of queue indices that are - ///< available for this device. - UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS = 106, ///< [::ur_bool_t] support the ::urKernelSetSpecializationConstants entry - ///< point - UR_DEVICE_INFO_MEMORY_BUS_WIDTH = 107, ///< [uint32_t][optional-query] return the width in bits of the memory bus - ///< interface of the device. - UR_DEVICE_INFO_MAX_WORK_GROUPS_3D = 108, ///< [size_t[3]] return max 3D work groups - UR_DEVICE_INFO_ASYNC_BARRIER = 109, ///< [::ur_bool_t] return true if Async Barrier is supported - UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT = 110, ///< [::ur_bool_t] return true if specifying memory channels is supported - UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED = 111, ///< [::ur_bool_t] Return true if the device supports enqueueing commands - ///< to read and write pipes from the host. - UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP = 112, ///< [uint32_t][optional-query] The maximum number of registers available - ///< per block. - UR_DEVICE_INFO_IP_VERSION = 113, ///< [uint32_t][optional-query] The device IP version. The meaning of the - ///< device IP version is implementation-defined, but newer devices should - ///< have a higher version than older devices. - UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT = 114, ///< [::ur_bool_t] return true if the device supports virtual memory. - UR_DEVICE_INFO_ESIMD_SUPPORT = 115, ///< [::ur_bool_t] return true if the device supports ESIMD. - UR_DEVICE_INFO_COMPONENT_DEVICES = 116, ///< [::ur_device_handle_t[]][optional-query] The set of component devices - ///< contained by this composite device. - UR_DEVICE_INFO_COMPOSITE_DEVICE = 117, ///< [::ur_device_handle_t][optional-query] The composite device containing - ///< this component device. - UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT = 118, ///< [::ur_bool_t] return true if the device supports the - ///< `EnqueueDeviceGlobalVariableWrite` and - ///< `EnqueueDeviceGlobalVariableRead` entry points. - UR_DEVICE_INFO_USM_POOL_SUPPORT = 119, ///< [::ur_bool_t] return true if the device supports USM pooling. Pertains - ///< to the `USMPool` entry points and usage of the `pool` parameter of the - ///< USM alloc entry points. - UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP = 0x1000, ///< [::ur_bool_t] Returns true if the device supports the use of - ///< command-buffers. - UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_CAPABILITIES_EXP = 0x1001, ///< [::ur_device_command_buffer_update_capability_flags_t] Command-buffer - ///< update capabilities of the device - UR_DEVICE_INFO_COMMAND_BUFFER_EVENT_SUPPORT_EXP = 0x1002, ///< [::ur_bool_t] Returns true if the device supports using event objects - ///< for command synchronization outside of a command-buffer. - UR_DEVICE_INFO_CLUSTER_LAUNCH_EXP = 0x1111, ///< [::ur_bool_t] return true if enqueue Cluster Launch is supported - UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP = 0x2000, ///< [::ur_bool_t] returns true if the device supports the creation of - ///< bindless images - UR_DEVICE_INFO_BINDLESS_IMAGES_SHARED_USM_SUPPORT_EXP = 0x2001, ///< [::ur_bool_t] returns true if the device supports the creation of - ///< bindless images backed by shared USM - UR_DEVICE_INFO_BINDLESS_IMAGES_1D_USM_SUPPORT_EXP = 0x2002, ///< [::ur_bool_t] returns true if the device supports the creation of 1D - ///< bindless images backed by USM - UR_DEVICE_INFO_BINDLESS_IMAGES_2D_USM_SUPPORT_EXP = 0x2003, ///< [::ur_bool_t] returns true if the device supports the creation of 2D - ///< bindless images backed by USM - UR_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP = 0x2004, ///< [uint32_t] returns the required alignment of the pitch between two - ///< rows of an image in bytes - UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP = 0x2005, ///< [size_t] returns the maximum linear width allowed for images allocated - ///< using USM - UR_DEVICE_INFO_MAX_IMAGE_LINEAR_HEIGHT_EXP = 0x2006, ///< [size_t] returns the maximum linear height allowed for images - ///< allocated using USM - UR_DEVICE_INFO_MAX_IMAGE_LINEAR_PITCH_EXP = 0x2007, ///< [size_t] returns the maximum linear pitch allowed for images allocated - ///< using USM - UR_DEVICE_INFO_MIPMAP_SUPPORT_EXP = 0x2008, ///< [::ur_bool_t] returns true if the device supports allocating mipmap - ///< resources - UR_DEVICE_INFO_MIPMAP_ANISOTROPY_SUPPORT_EXP = 0x2009, ///< [::ur_bool_t] returns true if the device supports sampling mipmap - ///< images with anisotropic filtering - UR_DEVICE_INFO_MIPMAP_MAX_ANISOTROPY_EXP = 0x200A, ///< [uint32_t] returns the maximum anisotropic ratio supported by the - ///< device - UR_DEVICE_INFO_MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP = 0x200B, ///< [::ur_bool_t] returns true if the device supports using images created - ///< from individual mipmap levels - UR_DEVICE_INFO_EXTERNAL_MEMORY_IMPORT_SUPPORT_EXP = 0x200C, ///< [::ur_bool_t] returns true if the device supports importing external - ///< memory resources - UR_DEVICE_INFO_EXTERNAL_SEMAPHORE_IMPORT_SUPPORT_EXP = 0x200E, ///< [::ur_bool_t] returns true if the device supports importing external - ///< semaphore resources - UR_DEVICE_INFO_CUBEMAP_SUPPORT_EXP = 0x2010, ///< [::ur_bool_t] returns true if the device supports allocating and - ///< accessing cubemap resources - UR_DEVICE_INFO_CUBEMAP_SEAMLESS_FILTERING_SUPPORT_EXP = 0x2011, ///< [::ur_bool_t] returns true if the device supports sampling cubemapped - ///< images across face boundaries - UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_EXP = 0x2012, ///< [::ur_bool_t] returns true if the device is capable of fetching USM - ///< backed 1D sampled image data. - UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_EXP = 0x2013, ///< [::ur_bool_t] returns true if the device is capable of fetching - ///< non-USM backed 1D sampled image data. - UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_EXP = 0x2014, ///< [::ur_bool_t] returns true if the device is capable of fetching USM - ///< backed 2D sampled image data. - UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_EXP = 0x2015, ///< [::ur_bool_t] returns true if the device is capable of fetching - ///< non-USM backed 2D sampled image data. - UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_EXP = 0x2017, ///< [::ur_bool_t] returns true if the device is capable of fetching - ///< non-USM backed 3D sampled image data. - UR_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT_EXP = 0x2018, ///< [::ur_bool_t] returns true if the device supports timestamp recording - UR_DEVICE_INFO_IMAGE_ARRAY_SUPPORT_EXP = 0x2019, ///< [::ur_bool_t] returns true if the device supports allocating and - ///< accessing image array resources. - UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_EXP = 0x201A, ///< [::ur_bool_t] returns true if the device supports unique addressing - ///< per dimension. - UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_EXP = 0x201B, ///< [::ur_bool_t] returns true if the device is capable of sampling USM - ///< backed 1D sampled image data. - UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_EXP = 0x201C, ///< [::ur_bool_t] returns true if the device is capable of sampling USM - ///< backed 2D sampled image data. - UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP = 0x2020, ///< [::ur_bool_t] returns true if the device supports enqueueing of native - ///< work - UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP = 0x2021, ///< [::ur_bool_t] returns true if the device supports low-power events. - UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP = 0x2022, ///< [::ur_exp_device_2d_block_array_capability_flags_t] return a bit-field - ///< of Intel GPU 2D block array capabilities + UR_DEVICE_INFO_TYPE = 0, ///< [::ur_device_type_t] type of the device + UR_DEVICE_INFO_VENDOR_ID = 1, ///< [uint32_t] vendor Id of the device + UR_DEVICE_INFO_DEVICE_ID = 2, ///< [uint32_t][optional-query] Id of the device + UR_DEVICE_INFO_MAX_COMPUTE_UNITS = 3, ///< [uint32_t] the number of compute units + UR_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS = 4, ///< [uint32_t] max work item dimensions + UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES = 5, ///< [size_t[]] return an array of max work item sizes + UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE = 6, ///< [size_t] max work group size + UR_DEVICE_INFO_SINGLE_FP_CONFIG = 7, ///< [::ur_device_fp_capability_flags_t] single precision floating point + ///< capability + UR_DEVICE_INFO_HALF_FP_CONFIG = 8, ///< [::ur_device_fp_capability_flags_t] half precision floating point + ///< capability + UR_DEVICE_INFO_DOUBLE_FP_CONFIG = 9, ///< [::ur_device_fp_capability_flags_t] double precision floating point + ///< capability + UR_DEVICE_INFO_QUEUE_PROPERTIES = 10, ///< [::ur_queue_flags_t] command queue properties supported by the device + UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_CHAR = 11, ///< [uint32_t] preferred vector width for char + UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_SHORT = 12, ///< [uint32_t] preferred vector width for short + UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT = 13, ///< [uint32_t] preferred vector width for int + UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG = 14, ///< [uint32_t] preferred vector width for long + UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT = 15, ///< [uint32_t] preferred vector width for float + UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_DOUBLE = 16, ///< [uint32_t] preferred vector width for double + UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF = 17, ///< [uint32_t] preferred vector width for half float + UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR = 18, ///< [uint32_t] native vector width for char + UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT = 19, ///< [uint32_t] native vector width for short + UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT = 20, ///< [uint32_t] native vector width for int + UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG = 21, ///< [uint32_t] native vector width for long + UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT = 22, ///< [uint32_t] native vector width for float + UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE = 23, ///< [uint32_t] native vector width for double + UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF = 24, ///< [uint32_t] native vector width for half float + UR_DEVICE_INFO_MAX_CLOCK_FREQUENCY = 25, ///< [uint32_t] max clock frequency in MHz + UR_DEVICE_INFO_MEMORY_CLOCK_RATE = 26, ///< [uint32_t][optional-query] memory clock frequency in MHz + UR_DEVICE_INFO_ADDRESS_BITS = 27, ///< [uint32_t] address bits + UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE = 28, ///< [uint64_t] max memory allocation size + UR_DEVICE_INFO_IMAGE_SUPPORT = 29, ///< [::ur_bool_t] images are supported + UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS = 30, ///< [uint32_t] max number of image objects arguments of a kernel declared + ///< with the read_only qualifier + UR_DEVICE_INFO_MAX_WRITE_IMAGE_ARGS = 31, ///< [uint32_t] max number of image objects arguments of a kernel declared + ///< with the write_only qualifier + UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS = 32, ///< [uint32_t] max number of image objects arguments of a kernel declared + ///< with the read_write qualifier + UR_DEVICE_INFO_IMAGE2D_MAX_WIDTH = 33, ///< [size_t] max width of Image2D object + UR_DEVICE_INFO_IMAGE2D_MAX_HEIGHT = 34, ///< [size_t] max height of Image2D object + UR_DEVICE_INFO_IMAGE3D_MAX_WIDTH = 35, ///< [size_t] max width of Image3D object + UR_DEVICE_INFO_IMAGE3D_MAX_HEIGHT = 36, ///< [size_t] max height of Image3D object + UR_DEVICE_INFO_IMAGE3D_MAX_DEPTH = 37, ///< [size_t] max depth of Image3D object + UR_DEVICE_INFO_IMAGE_MAX_BUFFER_SIZE = 38, ///< [size_t] max image buffer size + UR_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE = 39, ///< [size_t] max image array size + UR_DEVICE_INFO_MAX_SAMPLERS = 40, ///< [uint32_t] max number of samplers that can be used in a kernel + UR_DEVICE_INFO_MAX_PARAMETER_SIZE = 41, ///< [size_t] max size in bytes of all arguments passed to a kernel + UR_DEVICE_INFO_MEM_BASE_ADDR_ALIGN = 42, ///< [uint32_t] memory base address alignment + UR_DEVICE_INFO_GLOBAL_MEM_CACHE_TYPE = 43, ///< [::ur_device_mem_cache_type_t] global memory cache type + UR_DEVICE_INFO_GLOBAL_MEM_CACHELINE_SIZE = 44, ///< [uint32_t] global memory cache line size in bytes + UR_DEVICE_INFO_GLOBAL_MEM_CACHE_SIZE = 45, ///< [uint64_t] size of global memory cache in bytes + UR_DEVICE_INFO_GLOBAL_MEM_SIZE = 46, ///< [uint64_t] size of global memory in bytes + UR_DEVICE_INFO_GLOBAL_MEM_FREE = 47, ///< [uint64_t][optional-query] size of global memory which is free in + ///< bytes + UR_DEVICE_INFO_MAX_CONSTANT_BUFFER_SIZE = 48, ///< [uint64_t] max constant buffer size in bytes + UR_DEVICE_INFO_MAX_CONSTANT_ARGS = 49, ///< [uint32_t] max number of __const declared arguments in a kernel + UR_DEVICE_INFO_LOCAL_MEM_TYPE = 50, ///< [::ur_device_local_mem_type_t] local memory type + UR_DEVICE_INFO_LOCAL_MEM_SIZE = 51, ///< [uint64_t] local memory size in bytes + UR_DEVICE_INFO_ERROR_CORRECTION_SUPPORT = 52, ///< [::ur_bool_t] support error correction to global and local memory + UR_DEVICE_INFO_HOST_UNIFIED_MEMORY = 53, ///< [::ur_bool_t] unified host device memory + UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION = 54, ///< [size_t] profiling timer resolution in nanoseconds + UR_DEVICE_INFO_ENDIAN_LITTLE = 55, ///< [::ur_bool_t] little endian byte order + UR_DEVICE_INFO_AVAILABLE = 56, ///< [::ur_bool_t] device is available + UR_DEVICE_INFO_COMPILER_AVAILABLE = 57, ///< [::ur_bool_t] device compiler is available + UR_DEVICE_INFO_LINKER_AVAILABLE = 58, ///< [::ur_bool_t] device linker is available + UR_DEVICE_INFO_EXECUTION_CAPABILITIES = 59, ///< [::ur_device_exec_capability_flags_t] device kernel execution + ///< capability bit-field + UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES = 60, ///< [::ur_queue_flags_t] device command queue property bit-field + UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES = 61, ///< [::ur_queue_flags_t] host queue property bit-field + UR_DEVICE_INFO_BUILT_IN_KERNELS = 62, ///< [char[]] a semi-colon separated list of built-in kernels + UR_DEVICE_INFO_PLATFORM = 63, ///< [::ur_platform_handle_t] the platform associated with the device + UR_DEVICE_INFO_REFERENCE_COUNT = 64, ///< [uint32_t] Reference count of the device object. + ///< The reference count returned should be considered immediately stale. + ///< It is unsuitable for general use in applications. This feature is + ///< provided for identifying memory leaks. + UR_DEVICE_INFO_IL_VERSION = 65, ///< [char[]] IL version + UR_DEVICE_INFO_NAME = 66, ///< [char[]] Device name + UR_DEVICE_INFO_VENDOR = 67, ///< [char[]] Device vendor + UR_DEVICE_INFO_DRIVER_VERSION = 68, ///< [char[]] Driver version + UR_DEVICE_INFO_PROFILE = 69, ///< [char[]] Device profile + UR_DEVICE_INFO_VERSION = 70, ///< [char[]] Device version + UR_DEVICE_INFO_BACKEND_RUNTIME_VERSION = 71, ///< [char[]] Version of backend runtime + UR_DEVICE_INFO_EXTENSIONS = 72, ///< [char[]] Return a space separated list of extension names + UR_DEVICE_INFO_PRINTF_BUFFER_SIZE = 73, ///< [size_t] Maximum size in bytes of internal printf buffer + UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC = 74, ///< [::ur_bool_t] prefer user synchronization when sharing object with + ///< other API + UR_DEVICE_INFO_PARENT_DEVICE = 75, ///< [::ur_device_handle_t] return parent device handle + UR_DEVICE_INFO_SUPPORTED_PARTITIONS = 76, ///< [::ur_device_partition_t[]] Returns an array of partition types + ///< supported by the device + UR_DEVICE_INFO_PARTITION_MAX_SUB_DEVICES = 77, ///< [uint32_t] maximum number of sub-devices when the device is + ///< partitioned + UR_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN = 78, ///< [::ur_device_affinity_domain_flags_t] Returns a bit-field of the + ///< supported affinity domains for partitioning. + ///< If the device does not support any affinity domains, then 0 will be returned. + UR_DEVICE_INFO_PARTITION_TYPE = 79, ///< [::ur_device_partition_property_t[]] returns an array of properties + ///< specified in ::urDevicePartition + UR_DEVICE_INFO_MAX_NUM_SUB_GROUPS = 80, ///< [uint32_t] max number of sub groups + UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS = 81, ///< [::ur_bool_t] support sub group independent forward progress + UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL = 82, ///< [uint32_t[]] return an array of supported sub group sizes + UR_DEVICE_INFO_USM_HOST_SUPPORT = 83, ///< [::ur_device_usm_access_capability_flags_t] support USM host memory + ///< access + UR_DEVICE_INFO_USM_DEVICE_SUPPORT = 84, ///< [::ur_device_usm_access_capability_flags_t] support USM device memory + ///< access + UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT = 85, ///< [::ur_device_usm_access_capability_flags_t] support USM single device + ///< shared memory access + UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT = 86, ///< [::ur_device_usm_access_capability_flags_t] support USM cross device + ///< shared memory access + UR_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT = 87, ///< [::ur_device_usm_access_capability_flags_t] support USM system wide + ///< shared memory access + UR_DEVICE_INFO_UUID = 88, ///< [uint8_t[]][optional-query] return device UUID + UR_DEVICE_INFO_PCI_ADDRESS = 89, ///< [char[]][optional-query] return device PCI address + UR_DEVICE_INFO_GPU_EU_COUNT = 90, ///< [uint32_t][optional-query] return Intel GPU EU count + UR_DEVICE_INFO_GPU_EU_SIMD_WIDTH = 91, ///< [uint32_t][optional-query] return Intel GPU EU SIMD width + UR_DEVICE_INFO_GPU_EU_SLICES = 92, ///< [uint32_t][optional-query] return Intel GPU number of slices + UR_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE = 93, ///< [uint32_t][optional-query] return Intel GPU EU count per subslice + UR_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE = 94, ///< [uint32_t][optional-query] return Intel GPU number of subslices per + ///< slice + UR_DEVICE_INFO_GPU_HW_THREADS_PER_EU = 95, ///< [uint32_t][optional-query] return Intel GPU number of threads per EU + UR_DEVICE_INFO_MAX_MEMORY_BANDWIDTH = 96, ///< [uint32_t][optional-query] return max memory bandwidth in Mb/s + UR_DEVICE_INFO_IMAGE_SRGB = 97, ///< [::ur_bool_t] device supports sRGB images + UR_DEVICE_INFO_BUILD_ON_SUBDEVICE = 98, ///< [::ur_bool_t] Return true if sub-device should do its own program + ///< build + UR_DEVICE_INFO_ATOMIC_64 = 99, ///< [::ur_bool_t] support 64 bit atomics + UR_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES = 100, ///< [::ur_memory_order_capability_flags_t] return a bit-field of atomic + ///< memory order capabilities + UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES = 101, ///< [::ur_memory_scope_capability_flags_t] return a bit-field of atomic + ///< memory scope capabilities + UR_DEVICE_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES = 102, ///< [::ur_memory_order_capability_flags_t] return a bit-field of atomic + ///< memory fence order capabilities + UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES = 103, ///< [::ur_memory_scope_capability_flags_t] return a bit-field of atomic + ///< memory fence scope capabilities + UR_DEVICE_INFO_BFLOAT16 = 104, ///< [::ur_bool_t] support for bfloat16 + UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES = 105, ///< [uint32_t] Returns 1 if the device doesn't have a notion of a + ///< queue index. Otherwise, returns the number of queue indices that are + ///< available for this device. + UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS = 106, ///< [::ur_bool_t] support the ::urKernelSetSpecializationConstants entry + ///< point + UR_DEVICE_INFO_MEMORY_BUS_WIDTH = 107, ///< [uint32_t][optional-query] return the width in bits of the memory bus + ///< interface of the device. + UR_DEVICE_INFO_MAX_WORK_GROUPS_3D = 108, ///< [size_t[3]] return max 3D work groups + UR_DEVICE_INFO_ASYNC_BARRIER = 109, ///< [::ur_bool_t] return true if Async Barrier is supported + UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT = 110, ///< [::ur_bool_t] return true if specifying memory channels is supported + UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORT = 111, ///< [::ur_bool_t] Return true if the device supports enqueueing commands + ///< to read and write pipes from the host. + UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP = 112, ///< [uint32_t][optional-query] The maximum number of registers available + ///< per block. + UR_DEVICE_INFO_IP_VERSION = 113, ///< [uint32_t][optional-query] The device IP version. The meaning of the + ///< device IP version is implementation-defined, but newer devices should + ///< have a higher version than older devices. + UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT = 114, ///< [::ur_bool_t] return true if the device supports virtual memory. + UR_DEVICE_INFO_ESIMD_SUPPORT = 115, ///< [::ur_bool_t] return true if the device supports ESIMD. + UR_DEVICE_INFO_COMPONENT_DEVICES = 116, ///< [::ur_device_handle_t[]][optional-query] The set of component devices + ///< contained by this composite device. + UR_DEVICE_INFO_COMPOSITE_DEVICE = 117, ///< [::ur_device_handle_t][optional-query] The composite device containing + ///< this component device. + UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT = 118, ///< [::ur_bool_t] return true if the device supports the + ///< `EnqueueDeviceGlobalVariableWrite` and + ///< `EnqueueDeviceGlobalVariableRead` entry points. + UR_DEVICE_INFO_USM_POOL_SUPPORT = 119, ///< [::ur_bool_t] return true if the device supports USM pooling. Pertains + ///< to the `USMPool` entry points and usage of the `pool` parameter of the + ///< USM alloc entry points. + UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP = 0x1000, ///< [::ur_bool_t] Returns true if the device supports the use of + ///< command-buffers. + UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_CAPABILITIES_EXP = 0x1001, ///< [::ur_device_command_buffer_update_capability_flags_t] Command-buffer + ///< update capabilities of the device + UR_DEVICE_INFO_COMMAND_BUFFER_EVENT_SUPPORT_EXP = 0x1002, ///< [::ur_bool_t] Returns true if the device supports using event objects + ///< for command synchronization outside of a command-buffer. + UR_DEVICE_INFO_CLUSTER_LAUNCH_SUPPORT_EXP = 0x1111, ///< [::ur_bool_t] return true if enqueue Cluster Launch is supported + UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP = 0x2000, ///< [::ur_bool_t] returns true if the device supports the creation of + ///< bindless images + UR_DEVICE_INFO_BINDLESS_IMAGES_SHARED_USM_SUPPORT_EXP = 0x2001, ///< [::ur_bool_t] returns true if the device supports the creation of + ///< bindless images backed by shared USM + UR_DEVICE_INFO_BINDLESS_IMAGES_1D_USM_SUPPORT_EXP = 0x2002, ///< [::ur_bool_t] returns true if the device supports the creation of 1D + ///< bindless images backed by USM + UR_DEVICE_INFO_BINDLESS_IMAGES_2D_USM_SUPPORT_EXP = 0x2003, ///< [::ur_bool_t] returns true if the device supports the creation of 2D + ///< bindless images backed by USM + UR_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP = 0x2004, ///< [uint32_t] returns the required alignment of the pitch between two + ///< rows of an image in bytes + UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP = 0x2005, ///< [size_t] returns the maximum linear width allowed for images allocated + ///< using USM + UR_DEVICE_INFO_MAX_IMAGE_LINEAR_HEIGHT_EXP = 0x2006, ///< [size_t] returns the maximum linear height allowed for images + ///< allocated using USM + UR_DEVICE_INFO_MAX_IMAGE_LINEAR_PITCH_EXP = 0x2007, ///< [size_t] returns the maximum linear pitch allowed for images allocated + ///< using USM + UR_DEVICE_INFO_MIPMAP_SUPPORT_EXP = 0x2008, ///< [::ur_bool_t] returns true if the device supports allocating mipmap + ///< resources + UR_DEVICE_INFO_MIPMAP_ANISOTROPY_SUPPORT_EXP = 0x2009, ///< [::ur_bool_t] returns true if the device supports sampling mipmap + ///< images with anisotropic filtering + UR_DEVICE_INFO_MIPMAP_MAX_ANISOTROPY_EXP = 0x200A, ///< [uint32_t] returns the maximum anisotropic ratio supported by the + ///< device + UR_DEVICE_INFO_MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP = 0x200B, ///< [::ur_bool_t] returns true if the device supports using images created + ///< from individual mipmap levels + UR_DEVICE_INFO_EXTERNAL_MEMORY_IMPORT_SUPPORT_EXP = 0x200C, ///< [::ur_bool_t] returns true if the device supports importing external + ///< memory resources + UR_DEVICE_INFO_EXTERNAL_SEMAPHORE_IMPORT_SUPPORT_EXP = 0x200E, ///< [::ur_bool_t] returns true if the device supports importing external + ///< semaphore resources + UR_DEVICE_INFO_CUBEMAP_SUPPORT_EXP = 0x2010, ///< [::ur_bool_t] returns true if the device supports allocating and + ///< accessing cubemap resources + UR_DEVICE_INFO_CUBEMAP_SEAMLESS_FILTERING_SUPPORT_EXP = 0x2011, ///< [::ur_bool_t] returns true if the device supports sampling cubemapped + ///< images across face boundaries + UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_SUPPORT_EXP = 0x2012, ///< [::ur_bool_t] returns true if the device supports fetching USM backed + ///< 1D sampled image data. + UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_SUPPORT_EXP = 0x2013, ///< [::ur_bool_t] returns true if the device supports fetching non-USM + ///< backed 1D sampled image data. + UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_SUPPORT_EXP = 0x2014, ///< [::ur_bool_t] returns true if the device supports fetching USM backed + ///< 2D sampled image data. + UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_SUPPORT_EXP = 0x2015, ///< [::ur_bool_t] returns true if the device supports fetching non-USM + ///< backed 2D sampled image data. + UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_SUPPORT_EXP = 0x2017, ///< [::ur_bool_t] returns true if the device supports fetching non-USM + ///< backed 3D sampled image data. + UR_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT_EXP = 0x2018, ///< [::ur_bool_t] returns true if the device supports timestamp recording + UR_DEVICE_INFO_IMAGE_ARRAY_SUPPORT_EXP = 0x2019, ///< [::ur_bool_t] returns true if the device supports allocating and + ///< accessing image array resources. + UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_SUPPORT_EXP = 0x201A, ///< [::ur_bool_t] returns true if the device supports unique addressing + ///< per dimension. + UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_SUPPORT_EXP = 0x201B, ///< [::ur_bool_t] returns true if the device supports sampling USM backed + ///< 1D sampled image data. + UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_SUPPORT_EXP = 0x201C, ///< [::ur_bool_t] returns true if the device supports sampling USM backed + ///< 2D sampled image data. + UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP = 0x2020, ///< [::ur_bool_t] returns true if the device supports enqueueing of native + ///< work + UR_DEVICE_INFO_LOW_POWER_EVENTS_SUPPORT_EXP = 0x2021, ///< [::ur_bool_t] returns true if the device supports low-power events. + UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP = 0x2022, ///< [::ur_exp_device_2d_block_array_capability_flags_t] return a bit-field + ///< of Intel GPU 2D block array capabilities /// @cond UR_DEVICE_INFO_FORCE_UINT32 = 0x7fffffff /// @endcond @@ -9938,10 +9937,10 @@ urUSMReleaseExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Supported peer info typedef enum ur_exp_peer_info_t { - UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED = 0, ///< [int] 1 if P2P access is supported otherwise P2P access is not - ///< supported. - UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED = 1, ///< [int] 1 if atomic operations are supported over the P2P link, - ///< otherwise such operations are not supported. + UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORT = 0, ///< [int] 1 if P2P access is supported otherwise P2P access is not + ///< supported. + UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORT = 1, ///< [int] 1 if atomic operations are supported over the P2P link, + ///< otherwise such operations are not supported. /// @cond UR_EXP_PEER_INFO_FORCE_UINT32 = 0x7fffffff /// @endcond @@ -10051,7 +10050,7 @@ urUsmP2PDisablePeerAccessExp( /// + `NULL == commandDevice` /// + `NULL == peerDevice` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION -/// + `::UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED < propName` +/// + `::UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORT < propName` /// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_SIZE diff --git a/include/ur_print.hpp b/include/ur_print.hpp index 174932fce2..65bc7ed636 100644 --- a/include/ur_print.hpp +++ b/include/ur_print.hpp @@ -2366,8 +2366,8 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) { case UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE: os << "UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE"; break; - case UR_DEVICE_INFO_IMAGE_SUPPORTED: - os << "UR_DEVICE_INFO_IMAGE_SUPPORTED"; + case UR_DEVICE_INFO_IMAGE_SUPPORT: + os << "UR_DEVICE_INFO_IMAGE_SUPPORT"; break; case UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS: os << "UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS"; @@ -2612,8 +2612,8 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) { case UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT: os << "UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT"; break; - case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED: - os << "UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED"; + case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORT: + os << "UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORT"; break; case UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP: os << "UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP"; @@ -2648,8 +2648,8 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) { case UR_DEVICE_INFO_COMMAND_BUFFER_EVENT_SUPPORT_EXP: os << "UR_DEVICE_INFO_COMMAND_BUFFER_EVENT_SUPPORT_EXP"; break; - case UR_DEVICE_INFO_CLUSTER_LAUNCH_EXP: - os << "UR_DEVICE_INFO_CLUSTER_LAUNCH_EXP"; + case UR_DEVICE_INFO_CLUSTER_LAUNCH_SUPPORT_EXP: + os << "UR_DEVICE_INFO_CLUSTER_LAUNCH_SUPPORT_EXP"; break; case UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP: os << "UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP"; @@ -2699,20 +2699,20 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) { case UR_DEVICE_INFO_CUBEMAP_SEAMLESS_FILTERING_SUPPORT_EXP: os << "UR_DEVICE_INFO_CUBEMAP_SEAMLESS_FILTERING_SUPPORT_EXP"; break; - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_EXP: - os << "UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_EXP"; + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_SUPPORT_EXP: + os << "UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_SUPPORT_EXP"; break; - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_EXP: - os << "UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_EXP"; + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_SUPPORT_EXP: + os << "UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_SUPPORT_EXP"; break; - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_EXP: - os << "UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_EXP"; + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_SUPPORT_EXP: + os << "UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_SUPPORT_EXP"; break; - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_EXP: - os << "UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_EXP"; + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_SUPPORT_EXP: + os << "UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_SUPPORT_EXP"; break; - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_EXP: - os << "UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_EXP"; + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_SUPPORT_EXP: + os << "UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_SUPPORT_EXP"; break; case UR_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT_EXP: os << "UR_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT_EXP"; @@ -2720,20 +2720,20 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) { case UR_DEVICE_INFO_IMAGE_ARRAY_SUPPORT_EXP: os << "UR_DEVICE_INFO_IMAGE_ARRAY_SUPPORT_EXP"; break; - case UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_EXP: - os << "UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_EXP"; + case UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_SUPPORT_EXP: + os << "UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_SUPPORT_EXP"; break; - case UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_EXP: - os << "UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_EXP"; + case UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_SUPPORT_EXP: + os << "UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_SUPPORT_EXP"; break; - case UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_EXP: - os << "UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_EXP"; + case UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_SUPPORT_EXP: + os << "UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_SUPPORT_EXP"; break; case UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP: os << "UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP"; break; - case UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP: - os << "UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP"; + case UR_DEVICE_INFO_LOW_POWER_EVENTS_SUPPORT_EXP: + os << "UR_DEVICE_INFO_LOW_POWER_EVENTS_SUPPORT_EXP"; break; case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP: os << "UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP"; @@ -3108,7 +3108,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info os << ")"; } break; - case UR_DEVICE_INFO_IMAGE_SUPPORTED: { + case UR_DEVICE_INFO_IMAGE_SUPPORT: { const ur_bool_t *tptr = (const ur_bool_t *)ptr; if (sizeof(ur_bool_t) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")"; @@ -4048,7 +4048,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info os << ")"; } break; - case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED: { + case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORT: { const ur_bool_t *tptr = (const ur_bool_t *)ptr; if (sizeof(ur_bool_t) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")"; @@ -4197,7 +4197,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info os << ")"; } break; - case UR_DEVICE_INFO_CLUSTER_LAUNCH_EXP: { + case UR_DEVICE_INFO_CLUSTER_LAUNCH_SUPPORT_EXP: { const ur_bool_t *tptr = (const ur_bool_t *)ptr; if (sizeof(ur_bool_t) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")"; @@ -4401,7 +4401,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info os << ")"; } break; - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_SUPPORT_EXP: { const ur_bool_t *tptr = (const ur_bool_t *)ptr; if (sizeof(ur_bool_t) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")"; @@ -4413,7 +4413,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info os << ")"; } break; - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_SUPPORT_EXP: { const ur_bool_t *tptr = (const ur_bool_t *)ptr; if (sizeof(ur_bool_t) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")"; @@ -4425,7 +4425,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info os << ")"; } break; - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_SUPPORT_EXP: { const ur_bool_t *tptr = (const ur_bool_t *)ptr; if (sizeof(ur_bool_t) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")"; @@ -4437,7 +4437,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info os << ")"; } break; - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_SUPPORT_EXP: { const ur_bool_t *tptr = (const ur_bool_t *)ptr; if (sizeof(ur_bool_t) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")"; @@ -4449,7 +4449,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info os << ")"; } break; - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_SUPPORT_EXP: { const ur_bool_t *tptr = (const ur_bool_t *)ptr; if (sizeof(ur_bool_t) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")"; @@ -4485,7 +4485,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info os << ")"; } break; - case UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_EXP: { + case UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_SUPPORT_EXP: { const ur_bool_t *tptr = (const ur_bool_t *)ptr; if (sizeof(ur_bool_t) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")"; @@ -4497,7 +4497,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info os << ")"; } break; - case UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_SUPPORT_EXP: { const ur_bool_t *tptr = (const ur_bool_t *)ptr; if (sizeof(ur_bool_t) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")"; @@ -4509,7 +4509,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info os << ")"; } break; - case UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_SUPPORT_EXP: { const ur_bool_t *tptr = (const ur_bool_t *)ptr; if (sizeof(ur_bool_t) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")"; @@ -4533,7 +4533,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info os << ")"; } break; - case UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP: { + case UR_DEVICE_INFO_LOW_POWER_EVENTS_SUPPORT_EXP: { const ur_bool_t *tptr = (const ur_bool_t *)ptr; if (sizeof(ur_bool_t) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")"; @@ -10649,11 +10649,11 @@ inline std::ostream &operator<<(std::ostream &os, const struct ur_exp_launch_pro /// std::ostream & inline std::ostream &operator<<(std::ostream &os, enum ur_exp_peer_info_t value) { switch (value) { - case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED: - os << "UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED"; + case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORT: + os << "UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORT"; break; - case UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED: - os << "UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED"; + case UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORT: + os << "UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORT"; break; default: os << "unknown enumerator"; @@ -10671,7 +10671,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_exp_peer_in } switch (value) { - case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED: { + case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORT: { const int *tptr = (const int *)ptr; if (sizeof(int) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(int) << ")"; @@ -10683,7 +10683,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_exp_peer_in os << ")"; } break; - case UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED: { + case UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORT: { const int *tptr = (const int *)ptr; if (sizeof(int) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(int) << ")"; diff --git a/scripts/core/EXP-BINDLESS-IMAGES.rst b/scripts/core/EXP-BINDLESS-IMAGES.rst index c2b3d1114e..ac4dd06947 100644 --- a/scripts/core/EXP-BINDLESS-IMAGES.rst +++ b/scripts/core/EXP-BINDLESS-IMAGES.rst @@ -90,15 +90,15 @@ Enums * ${X}_DEVICE_INFO_EXTERNAL_SEMAPHORE_IMPORT_SUPPORT_EXP * ${X}_DEVICE_INFO_CUBEMAP_SUPPORT_EXP * ${X}_DEVICE_INFO_CUBEMAP_SEAMLESS_FILTERING_SUPPORT_EXP - * ${X}_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_EXP - * ${X}_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_EXP - * ${X}_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_EXP - * ${X}_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_EXP - * ${X}_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_EXP + * ${X}_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_SUPPORT_EXP + * ${X}_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_SUPPORT_EXP + * ${X}_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_SUPPORT_EXP + * ${X}_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_SUPPORT_EXP + * ${X}_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_SUPPORT_EXP * ${X}_DEVICE_INFO_IMAGE_ARRAY_SUPPORT_EXP - * ${X}_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_EXP - * ${X}_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_EXP - * ${X}_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_EXP + * ${X}_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_SUPPORT_EXP + * ${X}_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_SUPPORT_EXP + * ${X}_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_SUPPORT_EXP * ${x}_command_t * ${X}_COMMAND_EXTERNAL_SEMAPHORE_WAIT_EXP diff --git a/scripts/core/EXP-LOW-POWER-EVENTS.rst b/scripts/core/EXP-LOW-POWER-EVENTS.rst index 43f2032527..c4e8273545 100644 --- a/scripts/core/EXP-LOW-POWER-EVENTS.rst +++ b/scripts/core/EXP-LOW-POWER-EVENTS.rst @@ -47,7 +47,7 @@ Enums ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * ${x}_device_info_t - * ${X}_DEVICE_INFO_LOW_POWER_EVENTS_EXP + * ${X}_DEVICE_INFO_LOW_POWER_EVENTS_SUPPORT_EXP * ${x}_queue_flags_t * ${X}_QUEUE_FLAG_LOW_POWER_EVENTS_EXP * ${x}_exp_enqueue_ext_flags_t @@ -78,7 +78,7 @@ Support -------------------------------------------------------------------------------- Adapters which support this experimental feature *must* return true for the new -``${X}_DEVICE_INFO_LOW_POWER_EVENTS_EXP`` device info query. +``${X}_DEVICE_INFO_LOW_POWER_EVENTS_SUPPORT_EXP`` device info query. Contributors diff --git a/scripts/core/INTRO.rst b/scripts/core/INTRO.rst index 9a46d12170..f0458c538b 100644 --- a/scripts/core/INTRO.rst +++ b/scripts/core/INTRO.rst @@ -430,6 +430,13 @@ no valid platforms, then the tests will fail. Command line arguments take priori A (case insensitive) backend to force the test to use. For example, `opencl`, `level_zero`, `hip` and so on. +.. envvar:: UR_CTS_ALSO_RUN_KNOWN_FAILURES + + A boolean option to enable running tests which have been marked as known + failures using the :c:macro:`UUR_KNOWN_FAILURE_ON` macro. Enabled when the + environment variable is set to any of the following values: ``1``, ``on``, + ``ON``, ``yes``, ``YES``, ``true``, ``TRUE``. + Service identifiers --------------------- diff --git a/scripts/core/device.yml b/scripts/core/device.yml index ce671c24d6..8bd305e690 100644 --- a/scripts/core/device.yml +++ b/scripts/core/device.yml @@ -253,7 +253,7 @@ etors: desc: "[uint32_t] address bits" - name: MAX_MEM_ALLOC_SIZE desc: "[uint64_t] max memory allocation size" - - name: IMAGE_SUPPORTED + - name: IMAGE_SUPPORT desc: "[$x_bool_t] images are supported" - name: MAX_READ_IMAGE_ARGS desc: "[uint32_t] max number of image objects arguments of a kernel declared with the read_only qualifier" @@ -359,7 +359,7 @@ etors: [$x_device_affinity_domain_flags_t] Returns a bit-field of the supported affinity domains for partitioning. If the device does not support any affinity domains, then 0 will be returned. - name: PARTITION_TYPE - desc: "[$x_device_partition_property_t[]] return an array of $x_device_partition_property_t for properties specified in $xDevicePartition" + desc: "[$x_device_partition_property_t[]] returns an array of properties specified in $xDevicePartition" - name: MAX_NUM_SUB_GROUPS desc: "[uint32_t] max number of sub groups" - name: SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS @@ -425,7 +425,7 @@ etors: desc: "[$x_bool_t] return true if Async Barrier is supported" - name: MEM_CHANNEL_SUPPORT desc: "[$x_bool_t] return true if specifying memory channels is supported" - - name: HOST_PIPE_READ_WRITE_SUPPORTED + - name: HOST_PIPE_READ_WRITE_SUPPORT desc: "[$x_bool_t] Return true if the device supports enqueueing commands to read and write pipes from the host." - name: MAX_REGISTERS_PER_WORK_GROUP desc: "[uint32_t][optional-query] The maximum number of registers available per block." diff --git a/scripts/core/exp-bindless-images.yml b/scripts/core/exp-bindless-images.yml index 5648c56333..2c30ac0e78 100644 --- a/scripts/core/exp-bindless-images.yml +++ b/scripts/core/exp-bindless-images.yml @@ -86,33 +86,33 @@ etors: - name: CUBEMAP_SEAMLESS_FILTERING_SUPPORT_EXP value: "0x2011" desc: "[$x_bool_t] returns true if the device supports sampling cubemapped images across face boundaries" - - name: BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_EXP + - name: BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_SUPPORT_EXP value: "0x2012" - desc: "[$x_bool_t] returns true if the device is capable of fetching USM backed 1D sampled image data." - - name: BINDLESS_SAMPLED_IMAGE_FETCH_1D_EXP + desc: "[$x_bool_t] returns true if the device supports fetching USM backed 1D sampled image data." + - name: BINDLESS_SAMPLED_IMAGE_FETCH_1D_SUPPORT_EXP value: "0x2013" - desc: "[$x_bool_t] returns true if the device is capable of fetching non-USM backed 1D sampled image data." - - name: BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_EXP + desc: "[$x_bool_t] returns true if the device supports fetching non-USM backed 1D sampled image data." + - name: BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_SUPPORT_EXP value: "0x2014" - desc: "[$x_bool_t] returns true if the device is capable of fetching USM backed 2D sampled image data." - - name: BINDLESS_SAMPLED_IMAGE_FETCH_2D_EXP + desc: "[$x_bool_t] returns true if the device supports fetching USM backed 2D sampled image data." + - name: BINDLESS_SAMPLED_IMAGE_FETCH_2D_SUPPORT_EXP value: "0x2015" - desc: "[$x_bool_t] returns true if the device is capable of fetching non-USM backed 2D sampled image data." - - name: BINDLESS_SAMPLED_IMAGE_FETCH_3D_EXP + desc: "[$x_bool_t] returns true if the device supports fetching non-USM backed 2D sampled image data." + - name: BINDLESS_SAMPLED_IMAGE_FETCH_3D_SUPPORT_EXP value: "0x2017" - desc: "[$x_bool_t] returns true if the device is capable of fetching non-USM backed 3D sampled image data." + desc: "[$x_bool_t] returns true if the device supports fetching non-USM backed 3D sampled image data." - name: IMAGE_ARRAY_SUPPORT_EXP value: "0x2019" desc: "[$x_bool_t] returns true if the device supports allocating and accessing image array resources." - - name: BINDLESS_UNIQUE_ADDRESSING_PER_DIM_EXP + - name: BINDLESS_UNIQUE_ADDRESSING_PER_DIM_SUPPORT_EXP value: "0x201A" desc: "[$x_bool_t] returns true if the device supports unique addressing per dimension." - - name: BINDLESS_SAMPLE_1D_USM_EXP + - name: BINDLESS_SAMPLE_1D_USM_SUPPORT_EXP value: "0x201B" - desc: "[$x_bool_t] returns true if the device is capable of sampling USM backed 1D sampled image data." - - name: BINDLESS_SAMPLE_2D_USM_EXP + desc: "[$x_bool_t] returns true if the device supports sampling USM backed 1D sampled image data." + - name: BINDLESS_SAMPLE_2D_USM_SUPPORT_EXP value: "0x201C" - desc: "[$x_bool_t] returns true if the device is capable of sampling USM backed 2D sampled image data." + desc: "[$x_bool_t] returns true if the device supports sampling USM backed 2D sampled image data." --- #-------------------------------------------------------------------------- type: enum extend: true diff --git a/scripts/core/exp-launch-properties.yml b/scripts/core/exp-launch-properties.yml index ca28421815..378dfd95e2 100644 --- a/scripts/core/exp-launch-properties.yml +++ b/scripts/core/exp-launch-properties.yml @@ -144,6 +144,6 @@ typed_etors: true desc: "Extension enums to $x_device_info_t to support arch specific launch properties." name: $x_device_info_t etors: - - name: CLUSTER_LAUNCH_EXP + - name: CLUSTER_LAUNCH_SUPPORT_EXP value: "0x1111" desc: "[$x_bool_t] return true if enqueue Cluster Launch is supported" diff --git a/scripts/core/exp-low-power-events.yml b/scripts/core/exp-low-power-events.yml index f116eaf73a..f9ce931bd0 100644 --- a/scripts/core/exp-low-power-events.yml +++ b/scripts/core/exp-low-power-events.yml @@ -19,7 +19,7 @@ typed_etors: true desc: "Extension enums to $x_device_info_t to support low-power events." name: $x_device_info_t etors: - - name: LOW_POWER_EVENTS_EXP + - name: LOW_POWER_EVENTS_SUPPORT_EXP value: "0x2021" desc: "[$x_bool_t] returns true if the device supports low-power events." diff --git a/scripts/core/exp-usm-p2p.yml b/scripts/core/exp-usm-p2p.yml index f3ba303c34..5add865ba6 100644 --- a/scripts/core/exp-usm-p2p.yml +++ b/scripts/core/exp-usm-p2p.yml @@ -23,9 +23,9 @@ class: $xUsmP2P name: $x_exp_peer_info_t typed_etors: True etors: - - name: UR_PEER_ACCESS_SUPPORTED + - name: UR_PEER_ACCESS_SUPPORT desc: "[int] 1 if P2P access is supported otherwise P2P access is not supported." - - name: UR_PEER_ATOMICS_SUPPORTED + - name: UR_PEER_ATOMICS_SUPPORT desc: "[int] 1 if atomic operations are supported over the P2P link, otherwise such operations are not supported." --- #-------------------------------------------------------------------------- type: function diff --git a/source/adapters/cuda/device.cpp b/source/adapters/cuda/device.cpp index 476e0c40a7..ff036d79d4 100644 --- a/source/adapters/cuda/device.cpp +++ b/source/adapters/cuda/device.cpp @@ -282,7 +282,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, case UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE: { return ReturnValue(uint64_t{hDevice->getMaxAllocSize()}); } - case UR_DEVICE_INFO_IMAGE_SUPPORTED: { + case UR_DEVICE_INFO_IMAGE_SUPPORT: { bool Enabled = false; if (std::getenv("SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT") != nullptr || @@ -910,23 +910,23 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, // CUDA supports cubemap seamless filtering. return ReturnValue(static_cast(true)); } - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_SUPPORT_EXP: { // CUDA does support fetching 1D USM sampled image data. return ReturnValue(static_cast(true)); } - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_SUPPORT_EXP: { // CUDA does not support fetching 1D non-USM sampled image data. return ReturnValue(static_cast(false)); } - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_SUPPORT_EXP: { // CUDA does support fetching 2D USM sampled image data. return ReturnValue(static_cast(true)); } - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_SUPPORT_EXP: { // CUDA does support fetching 2D non-USM sampled image data. return ReturnValue(static_cast(true)); } - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_SUPPORT_EXP: { // CUDA does support fetching 3D non-USM sampled image data. return ReturnValue(static_cast(true)); } @@ -934,15 +934,15 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, // CUDA does support image arrays return ReturnValue(static_cast(true)); } - case UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_EXP: { + case UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_SUPPORT_EXP: { // CUDA does support unique addressing per dimension return ReturnValue(static_cast(true)); } - case UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_SUPPORT_EXP: { // CUDA does not support sampling 1D USM sampled image data. return ReturnValue(static_cast(false)); } - case UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_SUPPORT_EXP: { // CUDA does support sampling 1D USM sampled image data. return ReturnValue(static_cast(true)); } @@ -1068,7 +1068,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS: return ReturnValue(static_cast(false)); // TODO: Investigate if this information is available on CUDA. - case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED: + case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORT: return ReturnValue(static_cast(false)); case UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT: return ReturnValue(static_cast(true)); @@ -1105,12 +1105,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, UR_DEVICE_COMMAND_BUFFER_UPDATE_CAPABILITY_FLAG_EVENTS; return ReturnValue(UpdateCapabilities); } - case UR_DEVICE_INFO_CLUSTER_LAUNCH_EXP: { + case UR_DEVICE_INFO_CLUSTER_LAUNCH_SUPPORT_EXP: { int Value = getAttribute(hDevice, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR) >= 9; return ReturnValue(static_cast(Value)); } - case UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP: + case UR_DEVICE_INFO_LOW_POWER_EVENTS_SUPPORT_EXP: return ReturnValue(false); default: break; diff --git a/source/adapters/cuda/usm_p2p.cpp b/source/adapters/cuda/usm_p2p.cpp index e09220d730..bfb27f8856 100644 --- a/source/adapters/cuda/usm_p2p.cpp +++ b/source/adapters/cuda/usm_p2p.cpp @@ -45,11 +45,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp( try { ScopedContext active(commandDevice); switch (propName) { - case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED: { + case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORT: { cuAttr = CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED; break; } - case UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED: { + case UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORT: { cuAttr = CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED; break; } diff --git a/source/adapters/hip/device.cpp b/source/adapters/hip/device.cpp index c5ccee5bf4..74c6cd2a6e 100644 --- a/source/adapters/hip/device.cpp +++ b/source/adapters/hip/device.cpp @@ -223,7 +223,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return ReturnValue(uint64_t{MaxAlloc}); } - case UR_DEVICE_INFO_IMAGE_SUPPORTED: { + case UR_DEVICE_INFO_IMAGE_SUPPORT: { bool Enabled = false; if (std::getenv("UR_HIP_ENABLE_IMAGE_SUPPORT") != nullptr) { @@ -887,7 +887,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return ReturnValue(AddressBuffer, strnlen(AddressBuffer, AddressBufferSize - 1) + 1); } - case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED: + case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORT: return ReturnValue(ur_bool_t{false}); case UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT: return ReturnValue(ur_bool_t{false}); @@ -903,7 +903,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT: return ReturnValue(ur_bool_t{false}); case UR_DEVICE_INFO_USM_POOL_SUPPORT: +#ifdef UMF_ENABLE_POOL_TRACKING return ReturnValue(ur_bool_t{true}); +#else + return ReturnValue(ur_bool_t{false}); +#endif case UR_DEVICE_INFO_BFLOAT16: return ReturnValue(true); case UR_DEVICE_INFO_ASYNC_BARRIER: @@ -956,7 +960,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, } case UR_DEVICE_INFO_COMMAND_BUFFER_EVENT_SUPPORT_EXP: return ReturnValue(false); - case UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP: { + case UR_DEVICE_INFO_LOW_POWER_EVENTS_SUPPORT_EXP: { return ReturnValue(false); } default: diff --git a/source/adapters/hip/usm_p2p.cpp b/source/adapters/hip/usm_p2p.cpp index 5a3effd3c8..f5abb4a5a2 100644 --- a/source/adapters/hip/usm_p2p.cpp +++ b/source/adapters/hip/usm_p2p.cpp @@ -44,11 +44,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp( try { ScopedDevice active(commandDevice); switch (propName) { - case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED: { + case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORT: { hipAttr = hipDevP2PAttrAccessSupported; break; } - case UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED: { + case UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORT: { hipAttr = hipDevP2PAttrNativeAtomicSupported; break; } diff --git a/source/adapters/level_zero/device.cpp b/source/adapters/level_zero/device.cpp index 373826f0fd..7b28edbb28 100644 --- a/source/adapters/level_zero/device.cpp +++ b/source/adapters/level_zero/device.cpp @@ -369,7 +369,7 @@ ur_result_t urDeviceGetInfo( case UR_DEVICE_INFO_LOCAL_MEM_SIZE: return ReturnValue( uint64_t{Device->ZeDeviceComputeProperties->maxSharedLocalMemory}); - case UR_DEVICE_INFO_IMAGE_SUPPORTED: + case UR_DEVICE_INFO_IMAGE_SUPPORT: return ReturnValue(Device->ZeDeviceImageProperties->maxImageDims1D > 0); case UR_DEVICE_INFO_HOST_UNIFIED_MEMORY: return ReturnValue( @@ -485,7 +485,7 @@ ur_result_t urDeviceGetInfo( case UR_DEVICE_INFO_BUILT_IN_KERNELS: // TODO: To find out correct value return ReturnValue(""); - case UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP: + case UR_DEVICE_INFO_LOW_POWER_EVENTS_SUPPORT_EXP: return ReturnValue(static_cast(true)); case UR_DEVICE_INFO_QUEUE_PROPERTIES: return ReturnValue( @@ -1118,23 +1118,23 @@ ur_result_t urDeviceGetInfo( // L0 does not support cubemap seamless filtering. return ReturnValue(false); } - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_SUPPORT_EXP: { // L0 does not support fetching 1D USM sampled image data. return ReturnValue(false); } - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_SUPPORT_EXP: { // L0 does not not support fetching 1D non-USM sampled image data. return ReturnValue(false); } - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_SUPPORT_EXP: { // L0 does not support fetching 2D USM sampled image data. return ReturnValue(false); } - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_SUPPORT_EXP: { // L0 does not support fetching 2D non-USM sampled image data. return ReturnValue(false); } - case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_SUPPORT_EXP: { // L0 does not support fetching 3D non-USM sampled image data. return ReturnValue(false); } @@ -1142,15 +1142,15 @@ ur_result_t urDeviceGetInfo( // L0 does not support image arrays return ReturnValue(false); } - case UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_EXP: { + case UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_SUPPORT_EXP: { // L0 does not support unique addressing per dimension return ReturnValue(false); } - case UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_SUPPORT_EXP: { // L0 does not support sampling 1D USM sampled image data. return ReturnValue(false); } - case UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_EXP: { + case UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_SUPPORT_EXP: { // L0 does not support sampling 1D USM sampled image data. return ReturnValue(false); } @@ -1186,7 +1186,7 @@ ur_result_t urDeviceGetInfo( } case UR_DEVICE_INFO_ASYNC_BARRIER: return ReturnValue(false); - case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED: + case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORT: return ReturnValue(false); default: logger::error("Unsupported ParamName in urGetDeviceInfo"); diff --git a/source/adapters/level_zero/usm_p2p.cpp b/source/adapters/level_zero/usm_p2p.cpp index 756c76f8bc..0e57abf349 100644 --- a/source/adapters/level_zero/usm_p2p.cpp +++ b/source/adapters/level_zero/usm_p2p.cpp @@ -43,7 +43,7 @@ ur_result_t urUsmP2PPeerAccessGetInfoExp(ur_device_handle_t commandDevice, int propertyValue = 0; switch (propName) { - case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED: { + case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORT: { bool p2pAccessSupported = false; ZeStruct p2pProperties; ZE2UR_CALL(zeDeviceGetP2PProperties, @@ -58,7 +58,7 @@ ur_result_t urUsmP2PPeerAccessGetInfoExp(ur_device_handle_t commandDevice, propertyValue = p2pAccessSupported && p2pDeviceSupported; break; } - case UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED: { + case UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORT: { ZeStruct p2pProperties; ZE2UR_CALL(zeDeviceGetP2PProperties, (commandDevice->ZeDevice, peerDevice->ZeDevice, &p2pProperties)); diff --git a/source/adapters/native_cpu/device.cpp b/source/adapters/native_cpu/device.cpp index b00892d040..da5ef181ab 100644 --- a/source/adapters/native_cpu/device.cpp +++ b/source/adapters/native_cpu/device.cpp @@ -134,7 +134,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return ReturnValue(hDevice->Platform); case UR_DEVICE_INFO_NAME: return ReturnValue("SYCL Native CPU"); - case UR_DEVICE_INFO_IMAGE_SUPPORTED: + case UR_DEVICE_INFO_IMAGE_SUPPORT: return ReturnValue(bool{false}); case UR_DEVICE_INFO_DRIVER_VERSION: return ReturnValue("0.0.0"); @@ -426,8 +426,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, case UR_DEVICE_INFO_USM_POOL_SUPPORT: return ReturnValue(false); - case UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP: + case UR_DEVICE_INFO_LOW_POWER_EVENTS_SUPPORT_EXP: return ReturnValue(false); + + case UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES: + return ReturnValue(ur_queue_flags_t{0}); + default: DIE_NO_IMPLEMENTATION; } diff --git a/source/adapters/native_cpu/queue.cpp b/source/adapters/native_cpu/queue.cpp index e2dda24236..d59adf3b6b 100644 --- a/source/adapters/native_cpu/queue.cpp +++ b/source/adapters/native_cpu/queue.cpp @@ -83,5 +83,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueFinish(ur_queue_handle_t hQueue) { UR_APIEXPORT ur_result_t UR_APICALL urQueueFlush(ur_queue_handle_t hQueue) { std::ignore = hQueue; - DIE_NO_IMPLEMENTATION; + // The native cpu queue is greedy, flushes are a no-op. + return UR_RESULT_SUCCESS; } diff --git a/source/adapters/opencl/device.cpp b/source/adapters/opencl/device.cpp index dc5343b51c..30003f81a0 100644 --- a/source/adapters/opencl/device.cpp +++ b/source/adapters/opencl/device.cpp @@ -150,194 +150,6 @@ mapCLDeviceFpConfigToUR(cl_device_fp_config CLValue) { return URValue; } -static cl_int mapURDeviceInfoToCL(ur_device_info_t URPropName) { - - switch (static_cast(URPropName)) { - case UR_DEVICE_INFO_TYPE: - return CL_DEVICE_TYPE; - case UR_DEVICE_INFO_PARENT_DEVICE: - return CL_DEVICE_PARENT_DEVICE; - case UR_DEVICE_INFO_PLATFORM: - return CL_DEVICE_PLATFORM; - case UR_DEVICE_INFO_VENDOR_ID: - return CL_DEVICE_VENDOR_ID; - case UR_DEVICE_INFO_EXTENSIONS: - return CL_DEVICE_EXTENSIONS; - case UR_DEVICE_INFO_NAME: - return CL_DEVICE_NAME; - case UR_DEVICE_INFO_COMPILER_AVAILABLE: - return CL_DEVICE_COMPILER_AVAILABLE; - case UR_DEVICE_INFO_LINKER_AVAILABLE: - return CL_DEVICE_LINKER_AVAILABLE; - case UR_DEVICE_INFO_MAX_COMPUTE_UNITS: - return CL_DEVICE_MAX_COMPUTE_UNITS; - case UR_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS: - return CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS; - case UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE: - return CL_DEVICE_MAX_WORK_GROUP_SIZE; - case UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES: - return CL_DEVICE_MAX_WORK_ITEM_SIZES; - case UR_DEVICE_INFO_MAX_CLOCK_FREQUENCY: - return CL_DEVICE_MAX_CLOCK_FREQUENCY; - case UR_DEVICE_INFO_ADDRESS_BITS: - return CL_DEVICE_ADDRESS_BITS; - case UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE: - return CL_DEVICE_MAX_MEM_ALLOC_SIZE; - case UR_DEVICE_INFO_GLOBAL_MEM_SIZE: - return CL_DEVICE_GLOBAL_MEM_SIZE; - case UR_DEVICE_INFO_LOCAL_MEM_SIZE: - return CL_DEVICE_LOCAL_MEM_SIZE; - case UR_DEVICE_INFO_IMAGE_SUPPORTED: - return CL_DEVICE_IMAGE_SUPPORT; - case UR_DEVICE_INFO_HOST_UNIFIED_MEMORY: - return CL_DEVICE_HOST_UNIFIED_MEMORY; - case UR_DEVICE_INFO_AVAILABLE: - return CL_DEVICE_AVAILABLE; - case UR_DEVICE_INFO_VENDOR: - return CL_DEVICE_VENDOR; - case UR_DEVICE_INFO_DRIVER_VERSION: - return CL_DRIVER_VERSION; - case UR_DEVICE_INFO_VERSION: - return CL_DEVICE_VERSION; - case UR_DEVICE_INFO_PARTITION_MAX_SUB_DEVICES: - return CL_DEVICE_PARTITION_MAX_SUB_DEVICES; - case UR_DEVICE_INFO_REFERENCE_COUNT: - return CL_DEVICE_REFERENCE_COUNT; - case UR_DEVICE_INFO_SUPPORTED_PARTITIONS: - return CL_DEVICE_PARTITION_PROPERTIES; - case UR_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN: - return CL_DEVICE_PARTITION_AFFINITY_DOMAIN; - case UR_DEVICE_INFO_PARTITION_TYPE: - return CL_DEVICE_PARTITION_TYPE; - case UR_EXT_DEVICE_INFO_OPENCL_C_VERSION: - return CL_DEVICE_OPENCL_C_VERSION; - case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC: - return CL_DEVICE_PREFERRED_INTEROP_USER_SYNC; - case UR_DEVICE_INFO_PRINTF_BUFFER_SIZE: - return CL_DEVICE_PRINTF_BUFFER_SIZE; - case UR_DEVICE_INFO_PROFILE: - return CL_DEVICE_PROFILE; - case UR_DEVICE_INFO_BUILT_IN_KERNELS: - return CL_DEVICE_BUILT_IN_KERNELS; - case UR_DEVICE_INFO_QUEUE_PROPERTIES: - return CL_DEVICE_QUEUE_PROPERTIES; - case UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES: - return CL_DEVICE_QUEUE_ON_HOST_PROPERTIES; - case UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES: - return CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES; - case UR_DEVICE_INFO_EXECUTION_CAPABILITIES: - return CL_DEVICE_EXECUTION_CAPABILITIES; - case UR_DEVICE_INFO_ENDIAN_LITTLE: - return CL_DEVICE_ENDIAN_LITTLE; - case UR_DEVICE_INFO_ERROR_CORRECTION_SUPPORT: - return CL_DEVICE_ERROR_CORRECTION_SUPPORT; - case UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION: - return CL_DEVICE_PROFILING_TIMER_RESOLUTION; - case UR_DEVICE_INFO_LOCAL_MEM_TYPE: - return CL_DEVICE_LOCAL_MEM_TYPE; - case UR_DEVICE_INFO_MAX_CONSTANT_ARGS: - return CL_DEVICE_MAX_CONSTANT_ARGS; - case UR_DEVICE_INFO_MAX_CONSTANT_BUFFER_SIZE: - return CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE; - case UR_DEVICE_INFO_GLOBAL_MEM_CACHE_TYPE: - return CL_DEVICE_GLOBAL_MEM_CACHE_TYPE; - case UR_DEVICE_INFO_GLOBAL_MEM_CACHELINE_SIZE: - return CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE; - case UR_DEVICE_INFO_GLOBAL_MEM_CACHE_SIZE: - return CL_DEVICE_GLOBAL_MEM_CACHE_SIZE; - case UR_DEVICE_INFO_MAX_PARAMETER_SIZE: - return CL_DEVICE_MAX_PARAMETER_SIZE; - case UR_DEVICE_INFO_MEM_BASE_ADDR_ALIGN: - return CL_DEVICE_MEM_BASE_ADDR_ALIGN; - case UR_DEVICE_INFO_MAX_SAMPLERS: - return CL_DEVICE_MAX_SAMPLERS; - case UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS: - return CL_DEVICE_MAX_READ_IMAGE_ARGS; - case UR_DEVICE_INFO_MAX_WRITE_IMAGE_ARGS: - return CL_DEVICE_MAX_WRITE_IMAGE_ARGS; - case UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS: - return CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS; - case UR_DEVICE_INFO_SINGLE_FP_CONFIG: - return CL_DEVICE_SINGLE_FP_CONFIG; - case UR_DEVICE_INFO_HALF_FP_CONFIG: - return CL_DEVICE_HALF_FP_CONFIG; - case UR_DEVICE_INFO_DOUBLE_FP_CONFIG: - return CL_DEVICE_DOUBLE_FP_CONFIG; - case UR_DEVICE_INFO_IMAGE2D_MAX_WIDTH: - return CL_DEVICE_IMAGE2D_MAX_WIDTH; - case UR_DEVICE_INFO_IMAGE2D_MAX_HEIGHT: - return CL_DEVICE_IMAGE2D_MAX_HEIGHT; - case UR_DEVICE_INFO_IMAGE3D_MAX_WIDTH: - return CL_DEVICE_IMAGE3D_MAX_WIDTH; - case UR_DEVICE_INFO_IMAGE3D_MAX_HEIGHT: - return CL_DEVICE_IMAGE3D_MAX_HEIGHT; - case UR_DEVICE_INFO_IMAGE3D_MAX_DEPTH: - return CL_DEVICE_IMAGE3D_MAX_DEPTH; - case UR_DEVICE_INFO_IMAGE_MAX_BUFFER_SIZE: - return CL_DEVICE_IMAGE_MAX_BUFFER_SIZE; - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR: - return CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR; - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_CHAR: - return CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR; - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT: - return CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT; - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_SHORT: - return CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT; - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT: - return CL_DEVICE_NATIVE_VECTOR_WIDTH_INT; - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT: - return CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT; - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG: - return CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG; - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG: - return CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG; - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT: - return CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT; - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT: - return CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT; - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE: - return CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE; - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_DOUBLE: - return CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE; - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF: - return CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF; - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF: - return CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF; - case UR_DEVICE_INFO_MAX_NUM_SUB_GROUPS: - return CL_DEVICE_MAX_NUM_SUB_GROUPS; - case UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS: - return CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS; - case UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL: - return CL_DEVICE_SUB_GROUP_SIZES_INTEL; - case UR_DEVICE_INFO_IL_VERSION: - return CL_DEVICE_IL_VERSION; - case UR_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE: - return CL_DEVICE_IMAGE_MAX_ARRAY_SIZE; - case UR_DEVICE_INFO_USM_HOST_SUPPORT: - return CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL; - case UR_DEVICE_INFO_USM_DEVICE_SUPPORT: - return CL_DEVICE_DEVICE_MEM_CAPABILITIES_INTEL; - case UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT: - return CL_DEVICE_SINGLE_DEVICE_SHARED_MEM_CAPABILITIES_INTEL; - case UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT: - return CL_DEVICE_CROSS_DEVICE_SHARED_MEM_CAPABILITIES_INTEL; - case UR_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT: - return CL_DEVICE_SHARED_SYSTEM_MEM_CAPABILITIES_INTEL; - case UR_DEVICE_INFO_GPU_EU_SLICES: - return CL_DEVICE_NUM_SLICES_INTEL; - case UR_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE: - return CL_DEVICE_NUM_EUS_PER_SUB_SLICE_INTEL; - case UR_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE: - return CL_DEVICE_NUM_SUB_SLICES_PER_SLICE_INTEL; - case UR_DEVICE_INFO_GPU_HW_THREADS_PER_EU: - return CL_DEVICE_NUM_THREADS_PER_EU_INTEL; - case UR_DEVICE_INFO_IP_VERSION: - return CL_DEVICE_IP_VERSION_INTEL; - default: - return -1; - } -} - UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, ur_device_info_t propName, size_t propSize, @@ -346,7 +158,22 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); - const cl_device_info CLPropName = mapURDeviceInfoToCL(propName); + /* We can just use the OpenCL outputs because the sizes of OpenCL types + * are the same as UR. + * | CL | UR | Size | + * | char[] | char[] | 8 | + * | cl_uint | uint32_t | 4 | + * | cl_ulong | uint64_t | 8 | + * | size_t | size_t | 8 | + * | cl_platform_id | ur_platform_handle_t | 8 | + * | cl_device_id | ur_device_handle_t | 8 | + * + * These other types are equivalent: + * | cl_device_fp_config | ur_device_fp_capability_flags_t | + * | cl_bitfield / enum | ur_flags_t | + * | cl_bool | ur_bool_t | + * | cl_device_atomic_capabilities | ur_memory_order_capability_flags_t | + */ /* TODO UR: Casting to uint32_t to silence warnings due to some values not * being part of the enum. Can be removed once all UR_EXT enums are promoted @@ -355,7 +182,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, case UR_DEVICE_INFO_TYPE: { cl_device_type CLType; CL_RETURN_ON_FAILURE( - clGetDeviceInfo(cl_adapter::cast(hDevice), CLPropName, + clGetDeviceInfo(cl_adapter::cast(hDevice), CL_DEVICE_TYPE, sizeof(cl_device_type), &CLType, nullptr)); /* TODO UR: If the device is an Accelerator (FPGA, VPU, etc.), there is not @@ -401,15 +228,17 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return ReturnValue(Results.c_str(), Results.size() + 1); } case UR_DEVICE_INFO_SUPPORTED_PARTITIONS: { + const cl_device_info info_name = CL_DEVICE_PARTITION_PROPERTIES; + size_t CLSize; CL_RETURN_ON_FAILURE( - clGetDeviceInfo(cl_adapter::cast(hDevice), CLPropName, 0, + clGetDeviceInfo(cl_adapter::cast(hDevice), info_name, 0, nullptr, &CLSize)); const size_t NProperties = CLSize / sizeof(cl_device_partition_property); std::vector CLValue(NProperties); CL_RETURN_ON_FAILURE( - clGetDeviceInfo(cl_adapter::cast(hDevice), CLPropName, + clGetDeviceInfo(cl_adapter::cast(hDevice), info_name, CLSize, CLValue.data(), nullptr)); /* The OpenCL implementation returns a value of 0 if no properties are @@ -429,10 +258,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return ReturnValue(URValue.data(), URValue.size()); } case UR_DEVICE_INFO_PARTITION_TYPE: { + const cl_device_info info_name = CL_DEVICE_PARTITION_TYPE; size_t CLSize; CL_RETURN_ON_FAILURE( - clGetDeviceInfo(cl_adapter::cast(hDevice), CLPropName, 0, + clGetDeviceInfo(cl_adapter::cast(hDevice), info_name, 0, nullptr, &CLSize)); const size_t NProperties = CLSize / sizeof(cl_device_partition_property); @@ -448,7 +278,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, auto CLValue = reinterpret_cast(alloca(CLSize)); CL_RETURN_ON_FAILURE( - clGetDeviceInfo(cl_adapter::cast(hDevice), CLPropName, + clGetDeviceInfo(cl_adapter::cast(hDevice), info_name, CLSize, CLValue, nullptr)); std::vector URValue(NProperties - 1); @@ -525,27 +355,37 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return ReturnValue(1u); } } - case UR_DEVICE_INFO_SINGLE_FP_CONFIG: - case UR_DEVICE_INFO_HALF_FP_CONFIG: - case UR_DEVICE_INFO_DOUBLE_FP_CONFIG: { - /* CL type: cl_device_fp_config - * UR type: ur_device_fp_capability_flags_t */ - if (propName == UR_DEVICE_INFO_HALF_FP_CONFIG) { - bool Supported; - UR_RETURN_ON_FAILURE(cl_adapter::checkDeviceExtensions( - cl_adapter::cast(hDevice), {"cl_khr_fp16"}, Supported)); - - if (!Supported) { - // If we don't support the extension then our capabilities are 0. - ur_device_fp_capability_flags_t halfCapabilities = 0; - return ReturnValue(halfCapabilities); - } + case UR_DEVICE_INFO_SINGLE_FP_CONFIG: { + cl_device_fp_config CLValue; + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_SINGLE_FP_CONFIG, + sizeof(cl_device_fp_config), &CLValue, nullptr)); + + return ReturnValue(mapCLDeviceFpConfigToUR(CLValue)); + } + case UR_DEVICE_INFO_HALF_FP_CONFIG: { + bool Supported; + UR_RETURN_ON_FAILURE(cl_adapter::checkDeviceExtensions( + cl_adapter::cast(hDevice), {"cl_khr_fp16"}, Supported)); + + if (!Supported) { + // If we don't support the extension then our capabilities are 0. + ur_device_fp_capability_flags_t halfCapabilities = 0; + return ReturnValue(halfCapabilities); } cl_device_fp_config CLValue; - CL_RETURN_ON_FAILURE( - clGetDeviceInfo(cl_adapter::cast(hDevice), CLPropName, - sizeof(cl_device_fp_config), &CLValue, nullptr)); + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_HALF_FP_CONFIG, + sizeof(cl_device_fp_config), &CLValue, nullptr)); + + return ReturnValue(mapCLDeviceFpConfigToUR(CLValue)); + } + case UR_DEVICE_INFO_DOUBLE_FP_CONFIG: { + cl_device_fp_config CLValue; + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_DOUBLE_FP_CONFIG, + sizeof(cl_device_fp_config), &CLValue, nullptr)); return ReturnValue(mapCLDeviceFpConfigToUR(CLValue)); } @@ -596,8 +436,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQ_REL | UR_MEMORY_ORDER_CAPABILITY_FLAG_SEQ_CST; } - /* cl_device_atomic_capabilities is uint64_t and - * ur_memory_order_capability_flags_t is uint32_t */ + return ReturnValue( static_cast(URCapabilities)); } @@ -652,8 +491,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, } } - /* cl_device_atomic_capabilities is uint64_t and - * ur_memory_scope_capability_flags_t is uint32_t */ return ReturnValue( static_cast(URCapabilities)); } @@ -700,8 +537,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, } } - /* cl_device_atomic_capabilities is uint64_t and - * ur_memory_order_capability_flags_t is uint32_t */ return ReturnValue( static_cast(URCapabilities)); } @@ -771,8 +606,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, } } - /* cl_device_atomic_capabilities is uint64_t and - * ur_memory_scope_capability_flags_t is uint32_t */ return ReturnValue( static_cast(URCapabilities)); } @@ -833,7 +666,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, case UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP: { return ReturnValue(false); } - case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED: { + case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORT: { bool Supported = false; UR_RETURN_ON_FAILURE(cl_adapter::checkDeviceExtensions( cl_adapter::cast(hDevice), @@ -847,33 +680,132 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, {"cl_intel_global_variable_access"}, Supported)); return ReturnValue(Supported); } - case UR_DEVICE_INFO_QUEUE_PROPERTIES: - case UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES: - case UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES: - case UR_DEVICE_INFO_GLOBAL_MEM_CACHE_TYPE: - case UR_DEVICE_INFO_LOCAL_MEM_TYPE: - case UR_DEVICE_INFO_EXECUTION_CAPABILITIES: - case UR_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN: { - /* CL type: cl_bitfield / enum - * UR type: ur_flags_t (uint32_t) */ + case UR_DEVICE_INFO_QUEUE_PROPERTIES: { + cl_bitfield CLValue = 0; + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_QUEUE_PROPERTIES, + sizeof(cl_bitfield), &CLValue, nullptr)); + + return ReturnValue(static_cast(CLValue)); + } + case UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES: { + cl_bitfield CLValue = 0; + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES, + sizeof(cl_bitfield), &CLValue, nullptr)); + + return ReturnValue(static_cast(CLValue)); + } + case UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES: { + cl_bitfield CLValue = 0; + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, sizeof(cl_bitfield), + &CLValue, nullptr)); + + return ReturnValue(static_cast(CLValue)); + } + case UR_DEVICE_INFO_GLOBAL_MEM_CACHE_TYPE: { + cl_bitfield CLValue = 0; + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_GLOBAL_MEM_CACHE_TYPE, sizeof(cl_bitfield), + &CLValue, nullptr)); + + return ReturnValue(static_cast(CLValue)); + } + case UR_DEVICE_INFO_LOCAL_MEM_TYPE: { + cl_bitfield CLValue = 0; + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_LOCAL_MEM_TYPE, + sizeof(cl_bitfield), &CLValue, nullptr)); + + return ReturnValue(static_cast(CLValue)); + } + case UR_DEVICE_INFO_EXECUTION_CAPABILITIES: { + cl_bitfield CLValue = 0; + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_EXECUTION_CAPABILITIES, sizeof(cl_bitfield), + &CLValue, nullptr)); + return ReturnValue(static_cast(CLValue)); + } + case UR_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN: { cl_bitfield CLValue = 0; CL_RETURN_ON_FAILURE( - clGetDeviceInfo(cl_adapter::cast(hDevice), CLPropName, + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_PARTITION_AFFINITY_DOMAIN, sizeof(cl_bitfield), &CLValue, nullptr)); - /* We can just static_cast the output because OpenCL and UR bitfields - * map 1 to 1 for these properties. cl_bitfield is uint64_t and ur_flags_t - * types are uint32_t */ return ReturnValue(static_cast(CLValue)); } - case UR_DEVICE_INFO_USM_HOST_SUPPORT: - case UR_DEVICE_INFO_USM_DEVICE_SUPPORT: - case UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT: - case UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT: + case UR_DEVICE_INFO_USM_HOST_SUPPORT: { + bool Supported = false; + UR_RETURN_ON_FAILURE(cl_adapter::checkDeviceExtensions( + cl_adapter::cast(hDevice), + {"cl_intel_unified_shared_memory"}, Supported)); + if (Supported) { + cl_bitfield CLValue = 0; + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL, + sizeof(cl_bitfield), &CLValue, nullptr)); + return ReturnValue(static_cast(CLValue)); + } else { + return ReturnValue(0); + } + } + case UR_DEVICE_INFO_USM_DEVICE_SUPPORT: { + bool Supported = false; + UR_RETURN_ON_FAILURE(cl_adapter::checkDeviceExtensions( + cl_adapter::cast(hDevice), + {"cl_intel_unified_shared_memory"}, Supported)); + if (Supported) { + cl_bitfield CLValue = 0; + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_DEVICE_MEM_CAPABILITIES_INTEL, + sizeof(cl_bitfield), &CLValue, nullptr)); + return ReturnValue(static_cast(CLValue)); + } else { + return ReturnValue(0); + } + } + case UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT: { + bool Supported = false; + UR_RETURN_ON_FAILURE(cl_adapter::checkDeviceExtensions( + cl_adapter::cast(hDevice), + {"cl_intel_unified_shared_memory"}, Supported)); + if (Supported) { + cl_bitfield CLValue = 0; + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_SINGLE_DEVICE_SHARED_MEM_CAPABILITIES_INTEL, + sizeof(cl_bitfield), &CLValue, nullptr)); + return ReturnValue(static_cast(CLValue)); + } else { + return ReturnValue(0); + } + } + case UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT: { + bool Supported = false; + UR_RETURN_ON_FAILURE(cl_adapter::checkDeviceExtensions( + cl_adapter::cast(hDevice), + {"cl_intel_unified_shared_memory"}, Supported)); + if (Supported) { + cl_bitfield CLValue = 0; + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_CROSS_DEVICE_SHARED_MEM_CAPABILITIES_INTEL, + sizeof(cl_bitfield), &CLValue, nullptr)); + return ReturnValue(static_cast(CLValue)); + } else { + return ReturnValue(0); + } + } case UR_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT: { - /* CL type: cl_bitfield / enum - * UR type: ur_flags_t (uint32_t) */ bool Supported = false; UR_RETURN_ON_FAILURE(cl_adapter::checkDeviceExtensions( cl_adapter::cast(hDevice), @@ -881,36 +813,81 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, if (Supported) { cl_bitfield CLValue = 0; CL_RETURN_ON_FAILURE( - clGetDeviceInfo(cl_adapter::cast(hDevice), CLPropName, + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_SHARED_SYSTEM_MEM_CAPABILITIES_INTEL, sizeof(cl_bitfield), &CLValue, nullptr)); return ReturnValue(static_cast(CLValue)); } else { return ReturnValue(0); } } - case UR_DEVICE_INFO_IMAGE_SUPPORTED: - case UR_DEVICE_INFO_ERROR_CORRECTION_SUPPORT: - case UR_DEVICE_INFO_HOST_UNIFIED_MEMORY: - case UR_DEVICE_INFO_ENDIAN_LITTLE: - case UR_DEVICE_INFO_AVAILABLE: - case UR_DEVICE_INFO_COMPILER_AVAILABLE: - case UR_DEVICE_INFO_LINKER_AVAILABLE: - case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC: { - /* CL type: cl_bool - * UR type: ur_bool_t */ + case UR_DEVICE_INFO_IMAGE_SUPPORT: { + cl_bool CLValue; + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_IMAGE_SUPPORT, + sizeof(cl_bool), &CLValue, nullptr)); + return ReturnValue(static_cast(CLValue)); + } + case UR_DEVICE_INFO_ERROR_CORRECTION_SUPPORT: { cl_bool CLValue; CL_RETURN_ON_FAILURE( - clGetDeviceInfo(cl_adapter::cast(hDevice), CLPropName, - sizeof(cl_bool), &CLValue, nullptr)); + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_ERROR_CORRECTION_SUPPORT, sizeof(cl_bool), + &CLValue, nullptr)); - /* cl_bool is uint32_t and ur_bool_t is bool */ return ReturnValue(static_cast(CLValue)); } - case UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS: { - /* CL type: cl_bool - * UR type: ur_bool_t */ + case UR_DEVICE_INFO_HOST_UNIFIED_MEMORY: { + cl_bool CLValue; + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_HOST_UNIFIED_MEMORY, + sizeof(cl_bool), &CLValue, nullptr)); + + return ReturnValue(static_cast(CLValue)); + } + case UR_DEVICE_INFO_ENDIAN_LITTLE: { + cl_bool CLValue; + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_ENDIAN_LITTLE, + sizeof(cl_bool), &CLValue, nullptr)); + + return ReturnValue(static_cast(CLValue)); + } + case UR_DEVICE_INFO_AVAILABLE: { + cl_bool CLValue; + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_AVAILABLE, + sizeof(cl_bool), &CLValue, nullptr)); + + return ReturnValue(static_cast(CLValue)); + } + case UR_DEVICE_INFO_COMPILER_AVAILABLE: { + cl_bool CLValue; + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_COMPILER_AVAILABLE, + sizeof(cl_bool), &CLValue, nullptr)); + + return ReturnValue(static_cast(CLValue)); + } + case UR_DEVICE_INFO_LINKER_AVAILABLE: { + cl_bool CLValue; + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_LINKER_AVAILABLE, + sizeof(cl_bool), &CLValue, nullptr)); + return ReturnValue(static_cast(CLValue)); + } + case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC: { + cl_bool CLValue; + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_PREFERRED_INTEROP_USER_SYNC, sizeof(cl_bool), + &CLValue, nullptr)); + + return ReturnValue(static_cast(CLValue)); + } + case UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS: { oclv::OpenCLVersion DevVer; CL_RETURN_ON_FAILURE(cl_adapter::getDeviceVersion( cl_adapter::cast(hDevice), DevVer)); @@ -919,87 +896,421 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, if (DevVer >= oclv::V2_1) { cl_bool CLValue; CL_RETURN_ON_FAILURE( - clGetDeviceInfo(cl_adapter::cast(hDevice), CLPropName, + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS, sizeof(cl_bool), &CLValue, nullptr)); - /* cl_bool is uint32_t and ur_bool_t is bool */ return ReturnValue(static_cast(CLValue)); } else { return ReturnValue(false); } } - case UR_DEVICE_INFO_VENDOR_ID: - case UR_DEVICE_INFO_MAX_COMPUTE_UNITS: - case UR_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS: - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_CHAR: - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_SHORT: - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT: - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG: - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT: - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_DOUBLE: - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF: - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR: - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT: - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT: - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG: - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT: - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE: - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF: - case UR_DEVICE_INFO_MAX_CLOCK_FREQUENCY: - case UR_DEVICE_INFO_ADDRESS_BITS: - case UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS: - case UR_DEVICE_INFO_MAX_WRITE_IMAGE_ARGS: - case UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS: - case UR_DEVICE_INFO_MEM_BASE_ADDR_ALIGN: - case UR_DEVICE_INFO_MAX_SAMPLERS: - case UR_DEVICE_INFO_GLOBAL_MEM_CACHELINE_SIZE: - case UR_DEVICE_INFO_MAX_CONSTANT_ARGS: - case UR_DEVICE_INFO_REFERENCE_COUNT: - case UR_DEVICE_INFO_PARTITION_MAX_SUB_DEVICES: - case UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE: - case UR_DEVICE_INFO_GLOBAL_MEM_CACHE_SIZE: - case UR_DEVICE_INFO_GLOBAL_MEM_SIZE: - case UR_DEVICE_INFO_MAX_CONSTANT_BUFFER_SIZE: - case UR_DEVICE_INFO_LOCAL_MEM_SIZE: - case UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE: - case UR_DEVICE_INFO_IMAGE2D_MAX_WIDTH: - case UR_DEVICE_INFO_IMAGE2D_MAX_HEIGHT: - case UR_DEVICE_INFO_IMAGE3D_MAX_WIDTH: - case UR_DEVICE_INFO_IMAGE3D_MAX_HEIGHT: - case UR_DEVICE_INFO_IMAGE3D_MAX_DEPTH: - case UR_DEVICE_INFO_IMAGE_MAX_BUFFER_SIZE: - case UR_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE: - case UR_DEVICE_INFO_MAX_PARAMETER_SIZE: - case UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION: - case UR_DEVICE_INFO_PRINTF_BUFFER_SIZE: - case UR_DEVICE_INFO_PLATFORM: - case UR_DEVICE_INFO_PARENT_DEVICE: - case UR_DEVICE_INFO_IL_VERSION: - case UR_DEVICE_INFO_NAME: - case UR_DEVICE_INFO_VENDOR: - case UR_DEVICE_INFO_DRIVER_VERSION: - case UR_DEVICE_INFO_PROFILE: - case UR_DEVICE_INFO_VERSION: - case UR_EXT_DEVICE_INFO_OPENCL_C_VERSION: - case UR_DEVICE_INFO_BUILT_IN_KERNELS: - case UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES: { - /* We can just use the OpenCL outputs because the sizes of OpenCL types - * are the same as UR. - * | CL | UR | Size | - * | char[] | char[] | 8 | - * | cl_uint | uint32_t | 4 | - * | cl_ulong | uint64_t | 8 | - * | size_t | size_t | 8 | - * | cl_platform_id | ur_platform_handle_t | 8 | - * | ur_device_handle_t | cl_device_id | 8 | - */ + case UR_DEVICE_INFO_VENDOR_ID: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_VENDOR_ID, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_MAX_COMPUTE_UNITS: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_MAX_COMPUTE_UNITS, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_CHAR: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_SHORT: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_DOUBLE: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), + CL_DEVICE_NATIVE_VECTOR_WIDTH_INT, propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_MAX_CLOCK_FREQUENCY: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_MAX_CLOCK_FREQUENCY, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_ADDRESS_BITS: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_ADDRESS_BITS, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_MAX_READ_IMAGE_ARGS, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_MAX_WRITE_IMAGE_ARGS: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS: { + + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_MEM_BASE_ADDR_ALIGN: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_MEM_BASE_ADDR_ALIGN, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_MAX_SAMPLERS: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_MAX_SAMPLERS, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_GLOBAL_MEM_CACHELINE_SIZE: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_MAX_CONSTANT_ARGS: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_MAX_CONSTANT_ARGS, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_REFERENCE_COUNT: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_REFERENCE_COUNT, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_PARTITION_MAX_SUB_DEVICES: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_PARTITION_MAX_SUB_DEVICES, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_MAX_MEM_ALLOC_SIZE, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_GLOBAL_MEM_CACHE_SIZE: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), + CL_DEVICE_GLOBAL_MEM_CACHE_SIZE, propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_GLOBAL_MEM_SIZE: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_GLOBAL_MEM_SIZE, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_MAX_CONSTANT_BUFFER_SIZE: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_LOCAL_MEM_SIZE: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_LOCAL_MEM_SIZE, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_MAX_WORK_GROUP_SIZE, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_IMAGE2D_MAX_WIDTH: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_IMAGE2D_MAX_WIDTH, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_IMAGE2D_MAX_HEIGHT: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_IMAGE2D_MAX_HEIGHT, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_IMAGE3D_MAX_WIDTH: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_IMAGE3D_MAX_WIDTH, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_IMAGE3D_MAX_HEIGHT: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_IMAGE3D_MAX_HEIGHT, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_IMAGE3D_MAX_DEPTH: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_IMAGE3D_MAX_DEPTH, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_IMAGE_MAX_BUFFER_SIZE: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), + CL_DEVICE_IMAGE_MAX_BUFFER_SIZE, propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_IMAGE_MAX_ARRAY_SIZE, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_MAX_PARAMETER_SIZE: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_MAX_PARAMETER_SIZE, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_PROFILING_TIMER_RESOLUTION, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_PRINTF_BUFFER_SIZE: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_PRINTF_BUFFER_SIZE, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_PLATFORM: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_PLATFORM, propSize, + pPropValue, pPropSizeRet)); + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_PARENT_DEVICE: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_PARENT_DEVICE, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_IL_VERSION: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_IL_VERSION, propSize, + pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_NAME: { CL_RETURN_ON_FAILURE( - clGetDeviceInfo(cl_adapter::cast(hDevice), CLPropName, + clGetDeviceInfo(cl_adapter::cast(hDevice), CL_DEVICE_NAME, propSize, pPropValue, pPropSizeRet)); return UR_RESULT_SUCCESS; } + case UR_DEVICE_INFO_VENDOR: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_VENDOR, propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_DRIVER_VERSION: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DRIVER_VERSION, propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_PROFILE: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_PROFILE, propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_VERSION: { + CL_RETURN_ON_FAILURE( + clGetDeviceInfo(cl_adapter::cast(hDevice), + CL_DEVICE_VERSION, propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_EXT_DEVICE_INFO_OPENCL_C_VERSION: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_OPENCL_C_VERSION, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_BUILT_IN_KERNELS: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_BUILT_IN_KERNELS, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } + case UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES: { + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_MAX_WORK_ITEM_SIZES, + propSize, pPropValue, pPropSizeRet)); + + return UR_RESULT_SUCCESS; + } case UR_DEVICE_INFO_PCI_ADDRESS: { bool Supported = false; UR_RETURN_ON_FAILURE(cl_adapter::checkDeviceExtensions( @@ -1048,6 +1359,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return UR_RESULT_SUCCESS; } + case UR_DEVICE_INFO_GPU_EU_SLICES: case UR_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE: case UR_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE: @@ -1060,9 +1372,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, if (!Supported) { return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; } - CL_RETURN_ON_FAILURE( - clGetDeviceInfo(cl_adapter::cast(hDevice), CLPropName, - propSize, pPropValue, pPropSizeRet)); + CL_RETURN_ON_FAILURE(clGetDeviceInfo( + cl_adapter::cast(hDevice), CL_DEVICE_IP_VERSION_INTEL, + propSize, pPropValue, pPropSizeRet)); return UR_RESULT_SUCCESS; } @@ -1079,14 +1391,16 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, aThreadIsItsOwnSubGroup.size()); } + const cl_device_info info_name = CL_DEVICE_SUB_GROUP_SIZES_INTEL; + // Have to convert size_t to uint32_t size_t SubGroupSizesSize = 0; CL_RETURN_ON_FAILURE( - clGetDeviceInfo(cl_adapter::cast(hDevice), CLPropName, 0, + clGetDeviceInfo(cl_adapter::cast(hDevice), info_name, 0, nullptr, &SubGroupSizesSize)); std::vector SubGroupSizes(SubGroupSizesSize / sizeof(size_t)); CL_RETURN_ON_FAILURE( - clGetDeviceInfo(cl_adapter::cast(hDevice), CLPropName, + clGetDeviceInfo(cl_adapter::cast(hDevice), info_name, SubGroupSizesSize, SubGroupSizes.data(), nullptr)); return ReturnValue.template operator()(SubGroupSizes.data(), SubGroupSizes.size()); @@ -1129,14 +1443,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, // manually updated if support is ever implemented. case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS: case UR_DEVICE_INFO_BFLOAT16: - case UR_DEVICE_INFO_ASYNC_BARRIER: { - return ReturnValue(false); - } - + case UR_DEVICE_INFO_ASYNC_BARRIER: case UR_DEVICE_INFO_USM_POOL_SUPPORT: { return ReturnValue(false); } - /* TODO: Check regularly to see if support is enabled in OpenCL. Intel GPU * EU device-specific information extensions. Some of the queries are * enabled by cl_intel_device_attribute_query extension, but it's not yet in @@ -1187,8 +1497,56 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, } case UR_DEVICE_INFO_COMMAND_BUFFER_EVENT_SUPPORT_EXP: return ReturnValue(false); - case UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP: + case UR_DEVICE_INFO_LOW_POWER_EVENTS_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_CLUSTER_LAUNCH_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_BINDLESS_IMAGES_SHARED_USM_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_BINDLESS_IMAGES_1D_USM_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_BINDLESS_IMAGES_2D_USM_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_MIPMAP_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_MIPMAP_ANISOTROPY_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP: return ReturnValue(false); + case UR_DEVICE_INFO_EXTERNAL_MEMORY_IMPORT_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_EXTERNAL_SEMAPHORE_IMPORT_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_CUBEMAP_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_CUBEMAP_SEAMLESS_FILTERING_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_IMAGE_ARRAY_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP: + case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP: + case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_HEIGHT_EXP: + case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_PITCH_EXP: + case UR_DEVICE_INFO_MIPMAP_MAX_ANISOTROPY_EXP: + return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: { return UR_RESULT_ERROR_INVALID_ENUMERATION; } diff --git a/source/loader/layers/validation/ur_valddi.cpp b/source/loader/layers/validation/ur_valddi.cpp index 519fe9248e..8c504504f4 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -10176,7 +10176,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp( return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - if (UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED < propName) { + if (UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORT < propName) { return UR_RESULT_ERROR_INVALID_ENUMERATION; } diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index bfb51783a5..d523bc6d0e 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -9450,7 +9450,7 @@ ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp( /// + `NULL == commandDevice` /// + `NULL == peerDevice` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION -/// + `::UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED < propName` +/// + `::UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORT < propName` /// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_SIZE diff --git a/source/ur_api.cpp b/source/ur_api.cpp index 0e88a12052..89d7d3a72a 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -8016,7 +8016,7 @@ ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp( /// + `NULL == commandDevice` /// + `NULL == peerDevice` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION -/// + `::UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED < propName` +/// + `::UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORT < propName` /// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_SIZE diff --git a/test/adapters/CMakeLists.txt b/test/adapters/CMakeLists.txt index bbe6826b09..794ba82113 100644 --- a/test/adapters/CMakeLists.txt +++ b/test/adapters/CMakeLists.txt @@ -77,13 +77,13 @@ function(add_adapter_memcheck_test name) endfunction() if(UR_BUILD_ADAPTER_CUDA OR UR_BUILD_ADAPTER_ALL) - add_subdirectory(cuda) + # add_subdirectory(cuda) endif() if(UR_BUILD_ADAPTER_HIP OR UR_BUILD_ADAPTER_ALL) - add_subdirectory(hip) + # add_subdirectory(hip) endif() if(UR_BUILD_ADAPTER_L0 OR UR_BUILD_ADAPTER_L0_V2 OR UR_BUILD_ADAPTER_ALL) - add_subdirectory(level_zero) + # add_subdirectory(level_zero) endif() diff --git a/test/adapters/level_zero/v2/CMakeLists.txt b/test/adapters/level_zero/v2/CMakeLists.txt index df6b43c443..9869c168ed 100644 --- a/test/adapters/level_zero/v2/CMakeLists.txt +++ b/test/adapters/level_zero/v2/CMakeLists.txt @@ -29,35 +29,35 @@ function(add_unittest name) ) endfunction() -add_unittest(level_zero_command_list_cache - command_list_cache_test.cpp - ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/v2/command_list_cache.cpp -) +#add_unittest(level_zero_command_list_cache +# command_list_cache_test.cpp +# ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/v2/command_list_cache.cpp +#) -if(CXX_HAS_CFI_SANITIZE) - message(WARNING "Level Zero V2 Event Pool tests are disabled when using CFI sanitizer") - message(NOTE "See https://github.com/oneapi-src/unified-runtime/issues/2324") -else() - add_unittest(level_zero_event_pool - event_pool_test.cpp - ${PROJECT_SOURCE_DIR}/source/ur/ur.cpp - ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/adapter.cpp - ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/device.cpp - ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/platform.cpp - ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/v2/event_pool.cpp - ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/v2/event_pool_cache.cpp - ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/v2/event_provider_normal.cpp - ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/v2/event_provider_counter.cpp - ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/v2/event.cpp - ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/v2/queue_api.cpp - ) -endif() - -add_adapter_test(level_zero_memory_residency - FIXTURE DEVICES - SOURCES - memory_residency.cpp - ENVIRONMENT - "UR_ADAPTERS_FORCE_LOAD=\"$\"" - "ZES_ENABLE_SYSMAN=1" -) +#if(CXX_HAS_CFI_SANITIZE) +# message(WARNING "Level Zero V2 Event Pool tests are disabled when using CFI sanitizer") +# message(NOTE "See https://github.com/oneapi-src/unified-runtime/issues/2324") +#else() +# add_unittest(level_zero_event_pool +# event_pool_test.cpp +# ${PROJECT_SOURCE_DIR}/source/ur/ur.cpp +# ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/adapter.cpp +# ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/device.cpp +# ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/platform.cpp +# ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/v2/event_pool.cpp +# ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/v2/event_pool_cache.cpp +# ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/v2/event_provider_normal.cpp +# ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/v2/event_provider_counter.cpp +# ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/v2/event.cpp +# ${PROJECT_SOURCE_DIR}/source/adapters/level_zero/v2/queue_api.cpp +# ) +#endif() +# +#add_adapter_test(level_zero_memory_residency +# FIXTURE DEVICES +# SOURCES +# memory_residency.cpp +# ENVIRONMENT +# "UR_ADAPTERS_FORCE_LOAD=\"$\"" +# "ZES_ENABLE_SYSMAN=1" +#) diff --git a/test/conformance/CMakeLists.txt b/test/conformance/CMakeLists.txt index e71a829964..7c444c4f3d 100644 --- a/test/conformance/CMakeLists.txt +++ b/test/conformance/CMakeLists.txt @@ -19,28 +19,12 @@ function(add_test_adapter name adapter backend) set(MATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${name}_${adapter}.match") function(do_add_test tname env) - if(${UR_CONFORMANCE_ENABLE_MATCH_FILES} AND EXISTS ${MATCH_FILE}) - add_test(NAME ${tname} - COMMAND ${Python3_EXECUTABLE} ${UR_CONFORMANCE_TEST_DIR}/cts_exe.py - --failslist ${MATCH_FILE} - --test_command ${PROJECT_BINARY_DIR}/bin/${TEST_TARGET_NAME} - -- - --backend=${backend} - --devices_count=${UR_TEST_DEVICES_COUNT} - --platforms_count=${UR_TEST_PLATFORMS_COUNT} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - else() - separate_arguments(TEST_COMMAND) - add_test(NAME ${tname} - COMMAND ${TEST_COMMAND} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - endif() + separate_arguments(TEST_COMMAND) + add_test(NAME ${tname} + COMMAND ${TEST_COMMAND} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) - if(UR_CONFORMANCE_ENABLE_MATCH_FILES) - list(APPEND env GTEST_COLOR=yes) - endif() set_tests_properties(${tname} PROPERTIES ENVIRONMENT "${env}" LABELS "conformance;${adapter}") diff --git a/test/conformance/README.md b/test/conformance/README.md index 86df647c0d..0376c127d1 100644 --- a/test/conformance/README.md +++ b/test/conformance/README.md @@ -19,4 +19,54 @@ all available devices/platforms, set 0. The default value is 1. If you run binaries for the tests, you can use the parameter `--platforms_count=COUNT` or `--devices_count=COUNT`. To set test device/platform name you want to run the tests on, use -parameter `--platform=NAME` or `--device=NAME`. \ No newline at end of file +parameter `--platform=NAME` or `--device=NAME`. + +## Known failures + +The `UUR_KNOWN_FAILURE_ON` macro can be used to skip tests on devices where the +test is known to fail. This can be done in the following situations. + +For all devices in an adapter: + +```cpp +UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); +``` + +By substring match of the device name within and adapter: + +```cpp +UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) UHD Graphics 770"}); +``` + +In certain test suits, where there is no access to a device, the platform name +is used instead: + +```cpp +UUR_KNOWN_FAILURE_ON(uur::CUDA{"NVIDIA CUDA BACKEND"}); +``` + +When neither device or platform is available in a test suite, the name is +ignored and only the adapter backend is used to determine if the test is a +known failure. + +The macro is variadic making it possible to specify known failures for multiple +adapters in a single place and multiple names can also be provided per adapter: + +```cpp +UUR_KNOWN_FAILURE_ON( +uur::OpenCL{ + "Intel(R) UHD Graphics 750", + "Intel(R) UHD Graphics 770", +}, +uur::HIP{"Radeon RX 7700"}, +uur::NativeCPU{}); +``` + +The following adapter matcher objects are available: + +* `uur::OpenCL` +* `uur::LevelZero` +* `uur::LevelZeroV2` +* `uur::CUDA` +* `uur::HIP` +* `uur::NativeCPU` diff --git a/test/conformance/adapter/urAdapterGetInfo.cpp b/test/conformance/adapter/urAdapterGetInfo.cpp index b8604ccd19..a810738a74 100644 --- a/test/conformance/adapter/urAdapterGetInfo.cpp +++ b/test/conformance/adapter/urAdapterGetInfo.cpp @@ -16,8 +16,6 @@ TEST_P(urAdapterGetInfoTest, Backend) { size_t size = 0; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( urAdapterGetInfo(adapter, info_type, 0, nullptr, &size), info_type); - ASSERT_NE(size, 0); - ASSERT_EQ(size, sizeof(ur_adapter_backend_t)); std::vector info_data(size); @@ -38,6 +36,18 @@ TEST_P(urAdapterGetInfoTest, ReferenceCount) { ASSERT_GE(reference_count, 0); } +TEST_P(urAdapterGetInfoTest, Version) { + auto info_type = UR_ADAPTER_INFO_VERSION; + size_t size = 0; + ASSERT_SUCCESS(urAdapterGetInfo(adapter, info_type, 0, nullptr, &size)); + ASSERT_EQ(size, sizeof(uint32_t)); + + uint32_t version = 0; + ASSERT_SUCCESS( + urAdapterGetInfo(adapter, info_type, size, &version, nullptr)); + ASSERT_GE(version, 1); +} + TEST_P(urAdapterGetInfoTest, InvalidNullHandleAdapter) { size_t size = 0; ASSERT_EQ_RESULT( diff --git a/test/conformance/context/context_adapter_level_zero.match b/test/conformance/context/context_adapter_level_zero.match deleted file mode 100644 index 82c2e813e5..0000000000 --- a/test/conformance/context/context_adapter_level_zero.match +++ /dev/null @@ -1 +0,0 @@ -{{OPT}}urContextSetExtendedDeleterTest.Success/* diff --git a/test/conformance/context/context_adapter_level_zero_v2.match b/test/conformance/context/context_adapter_level_zero_v2.match deleted file mode 100644 index 82c2e813e5..0000000000 --- a/test/conformance/context/context_adapter_level_zero_v2.match +++ /dev/null @@ -1 +0,0 @@ -{{OPT}}urContextSetExtendedDeleterTest.Success/* diff --git a/test/conformance/context/context_adapter_native_cpu.match b/test/conformance/context/context_adapter_native_cpu.match deleted file mode 100644 index 82c2e813e5..0000000000 --- a/test/conformance/context/context_adapter_native_cpu.match +++ /dev/null @@ -1 +0,0 @@ -{{OPT}}urContextSetExtendedDeleterTest.Success/* diff --git a/test/conformance/context/urContextCreate.cpp b/test/conformance/context/urContextCreate.cpp index 0dc4341bd0..a3ee7837a9 100644 --- a/test/conformance/context/urContextCreate.cpp +++ b/test/conformance/context/urContextCreate.cpp @@ -31,14 +31,11 @@ TEST_P(urContextCreateTest, InvalidNullPointerDevices) { } TEST_P(urContextCreateTest, InvalidNullPointerContext) { - auto device = GetParam(); ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, urContextCreate(1, &device, nullptr, nullptr)); } TEST_P(urContextCreateTest, InvalidEnumeration) { - auto device = GetParam(); - ur_context_properties_t properties{UR_STRUCTURE_TYPE_CONTEXT_PROPERTIES, nullptr, UR_CONTEXT_FLAGS_MASK}; uur::raii::Context context = nullptr; @@ -48,7 +45,9 @@ TEST_P(urContextCreateTest, InvalidEnumeration) { } using urContextCreateMultiDeviceTest = uur::urAllDevicesTest; -TEST_F(urContextCreateMultiDeviceTest, Success) { +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urContextCreateMultiDeviceTest); + +TEST_P(urContextCreateMultiDeviceTest, Success) { if (devices.size() < 2) { GTEST_SKIP(); } diff --git a/test/conformance/context/urContextCreateWithNativeHandle.cpp b/test/conformance/context/urContextCreateWithNativeHandle.cpp index 599f402f77..d876c7190f 100644 --- a/test/conformance/context/urContextCreateWithNativeHandle.cpp +++ b/test/conformance/context/urContextCreateWithNativeHandle.cpp @@ -3,7 +3,6 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "uur/environment.h" #include using urContextCreateWithNativeHandleTest = uur::urContextTest; diff --git a/test/conformance/context/urContextGetInfo.cpp b/test/conformance/context/urContextGetInfo.cpp index bd6bdd3c3d..d439ca00b4 100644 --- a/test/conformance/context/urContextGetInfo.cpp +++ b/test/conformance/context/urContextGetInfo.cpp @@ -48,20 +48,20 @@ struct urContextGetInfoTestWithInfoParam ctx_info_mem_flags_map; }; -UUR_TEST_SUITE_P(urContextGetInfoTestWithInfoParam, - ::testing::Values( - - UR_CONTEXT_INFO_NUM_DEVICES, // - UR_CONTEXT_INFO_DEVICES, // - UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT, // - UR_CONTEXT_INFO_USM_FILL2D_SUPPORT, // - UR_CONTEXT_INFO_REFERENCE_COUNT, // - UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES, // - UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES, // - UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES, // - UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES // - ), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urContextGetInfoTestWithInfoParam, + ::testing::Values( + + UR_CONTEXT_INFO_NUM_DEVICES, // + UR_CONTEXT_INFO_DEVICES, // + UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT, // + UR_CONTEXT_INFO_USM_FILL2D_SUPPORT, // + UR_CONTEXT_INFO_REFERENCE_COUNT, // + UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES, // + UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES, // + UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES, // + UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES // + ), + uur::deviceTestWithParamPrinter); TEST_P(urContextGetInfoTestWithInfoParam, Success) { ur_context_info_t info = getParam(); @@ -83,22 +83,15 @@ TEST_P(urContextGetInfoTestWithInfoParam, Success) { case UR_CONTEXT_INFO_NUM_DEVICES: { auto returned_num_of_devices = reinterpret_cast(info_data.data()); - ASSERT_GE(uur::DevicesEnvironment::instance->devices.size(), - *returned_num_of_devices); + ASSERT_EQ(*returned_num_of_devices, 1); break; } case UR_CONTEXT_INFO_DEVICES: { auto returned_devices = reinterpret_cast(info_data.data()); size_t devices_count = info_size / sizeof(ur_device_handle_t); - ASSERT_GT(devices_count, 0); - for (uint32_t i = 0; i < devices_count; i++) { - auto &devices = uur::DevicesEnvironment::instance->devices; - auto queried_device = - std::find(devices.begin(), devices.end(), returned_devices[i]); - EXPECT_TRUE(queried_device != devices.end()) - << "device associated with the context is not valid"; - } + ASSERT_EQ(devices_count, 1); + ASSERT_EQ(returned_devices[0], device); break; } case UR_CONTEXT_INFO_REFERENCE_COUNT: { diff --git a/test/conformance/context/urContextSetExtendedDeleter.cpp b/test/conformance/context/urContextSetExtendedDeleter.cpp index ad09ac2179..b1b2dd25dd 100644 --- a/test/conformance/context/urContextSetExtendedDeleter.cpp +++ b/test/conformance/context/urContextSetExtendedDeleter.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "uur/fixtures.h" +#include "uur/known_failure.h" #include "uur/raii.h" using urContextSetExtendedDeleterTest = uur::urDeviceTest; @@ -11,6 +12,10 @@ using urContextSetExtendedDeleterTest = uur::urDeviceTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urContextSetExtendedDeleterTest); TEST_P(urContextSetExtendedDeleterTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + bool called = false; { uur::raii::Context context = nullptr; diff --git a/test/conformance/device/CMakeLists.txt b/test/conformance/device/CMakeLists.txt index 0f7da3d80c..b376eab767 100644 --- a/test/conformance/device/CMakeLists.txt +++ b/test/conformance/device/CMakeLists.txt @@ -3,7 +3,7 @@ # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -add_conformance_test_with_platform_environment(device +add_conformance_test_with_devices_environment(device urDeviceCreateWithNativeHandle.cpp urDeviceGet.cpp urDeviceGetGlobalTimestamps.cpp diff --git a/test/conformance/device/device_adapter_cuda.match b/test/conformance/device/device_adapter_cuda.match deleted file mode 100644 index e42f948b73..0000000000 --- a/test/conformance/device/device_adapter_cuda.match +++ /dev/null @@ -1,2 +0,0 @@ -{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS diff --git a/test/conformance/device/device_adapter_hip.match b/test/conformance/device/device_adapter_hip.match deleted file mode 100644 index 48e00debe4..0000000000 --- a/test/conformance/device/device_adapter_hip.match +++ /dev/null @@ -1 +0,0 @@ -{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime diff --git a/test/conformance/device/device_adapter_level_zero.match b/test/conformance/device/device_adapter_level_zero.match deleted file mode 100644 index 87140fb10c..0000000000 --- a/test/conformance/device/device_adapter_level_zero.match +++ /dev/null @@ -1,2 +0,0 @@ -{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime -{{OPT}}urDeviceGetInfoTest.Success/UR_DEVICE_INFO_GLOBAL_MEM_FREE diff --git a/test/conformance/device/device_adapter_level_zero_v2.match b/test/conformance/device/device_adapter_level_zero_v2.match deleted file mode 100644 index 87140fb10c..0000000000 --- a/test/conformance/device/device_adapter_level_zero_v2.match +++ /dev/null @@ -1,2 +0,0 @@ -{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime -{{OPT}}urDeviceGetInfoTest.Success/UR_DEVICE_INFO_GLOBAL_MEM_FREE diff --git a/test/conformance/device/device_adapter_native_cpu.match b/test/conformance/device/device_adapter_native_cpu.match deleted file mode 100644 index 2764ad4fd1..0000000000 --- a/test/conformance/device/device_adapter_native_cpu.match +++ /dev/null @@ -1,16 +0,0 @@ -urDeviceCreateWithNativeHandleTest.InvalidNullHandlePlatform -urDeviceCreateWithNativeHandleTest.InvalidNullPointerDevice -{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime -urDeviceGetInfoSingleTest.MaxWorkGroupSizeIsNonzero -{{OPT}}urDeviceSelectBinaryTest.Success -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_IL_VERSION -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_WORK_GROUPS_3D -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_ASYNC_BARRIER -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS diff --git a/test/conformance/device/urDeviceCreateWithNativeHandle.cpp b/test/conformance/device/urDeviceCreateWithNativeHandle.cpp index d72435c274..045c24b826 100644 --- a/test/conformance/device/urDeviceCreateWithNativeHandle.cpp +++ b/test/conformance/device/urDeviceCreateWithNativeHandle.cpp @@ -3,82 +3,78 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include -using urDeviceCreateWithNativeHandleTest = uur::urAllDevicesTest; +using urDeviceCreateWithNativeHandleTest = uur::urDeviceTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceCreateWithNativeHandleTest); -TEST_F(urDeviceCreateWithNativeHandleTest, Success) { - for (auto device : devices) { - ur_native_handle_t native_handle = 0; +TEST_P(urDeviceCreateWithNativeHandleTest, Success) { + ur_native_handle_t native_handle = 0; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( - urDeviceGetNativeHandle(device, &native_handle)); + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceGetNativeHandle(device, &native_handle)); - // We cannot assume anything about a native_handle, not even if it's - // `nullptr` since this could be a valid representation within a backend. - // We can however convert the native_handle back into a unified-runtime handle - // and perform some query on it to verify that it works. - ur_device_handle_t dev = nullptr; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceCreateWithNativeHandle( - native_handle, adapter, nullptr, &dev)); - ASSERT_NE(dev, nullptr); + // We cannot assume anything about a native_handle, not even if it's + // `nullptr` since this could be a valid representation within a backend. + // We can however convert the native_handle back into a unified-runtime handle + // and perform some query on it to verify that it works. + ur_device_handle_t dev = nullptr; + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceCreateWithNativeHandle(native_handle, adapter, nullptr, &dev)); + ASSERT_NE(dev, nullptr); - uint32_t dev_id = 0; - ASSERT_SUCCESS(urDeviceGetInfo(dev, UR_DEVICE_INFO_TYPE, - sizeof(uint32_t), &dev_id, nullptr)); - } + uint32_t dev_id = 0; + ASSERT_SUCCESS(urDeviceGetInfo(dev, UR_DEVICE_INFO_TYPE, sizeof(uint32_t), + &dev_id, nullptr)); } -TEST_F(urDeviceCreateWithNativeHandleTest, SuccessWithOwnedNativeHandle) { - for (auto device : devices) { - ur_native_handle_t native_handle = 0; +TEST_P(urDeviceCreateWithNativeHandleTest, SuccessWithOwnedNativeHandle) { + ur_native_handle_t native_handle = 0; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( - urDeviceGetNativeHandle(device, &native_handle)); + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceGetNativeHandle(device, &native_handle)); - ur_device_handle_t dev = nullptr; - ur_device_native_properties_t props{ - UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES, nullptr, true}; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceCreateWithNativeHandle( - native_handle, adapter, &props, &dev)); - ASSERT_NE(dev, nullptr); - } + ur_device_handle_t dev = nullptr; + ur_device_native_properties_t props{ + UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES, nullptr, true}; + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceCreateWithNativeHandle(native_handle, adapter, &props, &dev)); + ASSERT_NE(dev, nullptr); } -TEST_F(urDeviceCreateWithNativeHandleTest, SuccessWithUnOwnedNativeHandle) { - for (auto device : devices) { - ur_native_handle_t native_handle = 0; +TEST_P(urDeviceCreateWithNativeHandleTest, SuccessWithUnOwnedNativeHandle) { + ur_native_handle_t native_handle = 0; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( - urDeviceGetNativeHandle(device, &native_handle)); + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceGetNativeHandle(device, &native_handle)); - ur_device_handle_t dev = nullptr; - ur_device_native_properties_t props{ - UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES, nullptr, false}; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceCreateWithNativeHandle( - native_handle, adapter, &props, &dev)); - ASSERT_NE(dev, nullptr); - } + ur_device_handle_t dev = nullptr; + ur_device_native_properties_t props{ + UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES, nullptr, false}; + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceCreateWithNativeHandle(native_handle, adapter, &props, &dev)); + ASSERT_NE(dev, nullptr); } -TEST_F(urDeviceCreateWithNativeHandleTest, InvalidNullHandlePlatform) { - for (auto device : devices) { - ur_native_handle_t native_handle = 0; - ASSERT_SUCCESS(urDeviceGetNativeHandle(device, &native_handle)); +TEST_P(urDeviceCreateWithNativeHandleTest, InvalidNullHandlePlatform) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); - ur_device_handle_t dev = nullptr; - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, - urDeviceCreateWithNativeHandle(native_handle, nullptr, - nullptr, &dev)); - } + ur_native_handle_t native_handle = 0; + ASSERT_SUCCESS(urDeviceGetNativeHandle(device, &native_handle)); + + ur_device_handle_t dev = nullptr; + ASSERT_EQ_RESULT( + UR_RESULT_ERROR_INVALID_NULL_HANDLE, + urDeviceCreateWithNativeHandle(native_handle, nullptr, nullptr, &dev)); } -TEST_F(urDeviceCreateWithNativeHandleTest, InvalidNullPointerDevice) { - for (auto device : devices) { - ur_native_handle_t native_handle = 0; - ASSERT_SUCCESS(urDeviceGetNativeHandle(device, &native_handle)); +TEST_P(urDeviceCreateWithNativeHandleTest, InvalidNullPointerDevice) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + ur_native_handle_t native_handle = 0; + ASSERT_SUCCESS(urDeviceGetNativeHandle(device, &native_handle)); - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDeviceCreateWithNativeHandle(native_handle, adapter, - nullptr, nullptr)); - } + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDeviceCreateWithNativeHandle(native_handle, adapter, + nullptr, nullptr)); } diff --git a/test/conformance/device/urDeviceGet.cpp b/test/conformance/device/urDeviceGet.cpp index 5ce4c45906..efd9a75269 100644 --- a/test/conformance/device/urDeviceGet.cpp +++ b/test/conformance/device/urDeviceGet.cpp @@ -6,8 +6,9 @@ #include using urDeviceGetTest = uur::urPlatformTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urDeviceGetTest); -TEST_F(urDeviceGetTest, Success) { +TEST_P(urDeviceGetTest, Success) { uint32_t count = 0; ASSERT_SUCCESS( urDeviceGet(platform, UR_DEVICE_TYPE_ALL, 0, nullptr, &count)); @@ -20,7 +21,7 @@ TEST_F(urDeviceGetTest, Success) { } } -TEST_F(urDeviceGetTest, SuccessSubsetOfDevices) { +TEST_P(urDeviceGetTest, SuccessSubsetOfDevices) { uint32_t count; ASSERT_SUCCESS( urDeviceGet(platform, UR_DEVICE_TYPE_ALL, 0, nullptr, &count)); @@ -35,57 +36,21 @@ TEST_F(urDeviceGetTest, SuccessSubsetOfDevices) { } } -struct urDeviceGetTestWithDeviceTypeParam - : uur::urAllDevicesTest, - ::testing::WithParamInterface { - - void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(uur::urAllDevicesTest::SetUp()); - } -}; - -INSTANTIATE_TEST_SUITE_P( - , urDeviceGetTestWithDeviceTypeParam, - ::testing::Values(UR_DEVICE_TYPE_DEFAULT, UR_DEVICE_TYPE_GPU, - UR_DEVICE_TYPE_CPU, UR_DEVICE_TYPE_FPGA, - UR_DEVICE_TYPE_MCA, UR_DEVICE_TYPE_VPU), - [](const ::testing::TestParamInfo &info) { - std::stringstream ss; - ss << info.param; - return ss.str(); - }); - -TEST_P(urDeviceGetTestWithDeviceTypeParam, Success) { - ur_device_type_t device_type = GetParam(); - uint32_t count = 0; - ASSERT_SUCCESS(urDeviceGet(platform, device_type, 0, nullptr, &count)); - ASSERT_GE(devices.size(), count); - - if (count > 0) { - std::vector devices(count); - ASSERT_SUCCESS( - urDeviceGet(platform, device_type, count, devices.data(), nullptr)); - for (auto device : devices) { - ASSERT_NE(nullptr, device); - } - } -} - -TEST_F(urDeviceGetTest, InvalidNullHandlePlatform) { +TEST_P(urDeviceGetTest, InvalidNullHandlePlatform) { uint32_t count; ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_NULL_HANDLE, urDeviceGet(nullptr, UR_DEVICE_TYPE_ALL, 0, nullptr, &count)); } -TEST_F(urDeviceGetTest, InvalidEnumerationDevicesType) { +TEST_P(urDeviceGetTest, InvalidEnumerationDevicesType) { uint32_t count; ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_ENUMERATION, urDeviceGet(platform, UR_DEVICE_TYPE_FORCE_UINT32, 0, nullptr, &count)); } -TEST_F(urDeviceGetTest, InvalidSizeNumEntries) { +TEST_P(urDeviceGetTest, InvalidSizeNumEntries) { uint32_t count = 0; ASSERT_SUCCESS( urDeviceGet(platform, UR_DEVICE_TYPE_ALL, 0, nullptr, &count)); @@ -96,7 +61,7 @@ TEST_F(urDeviceGetTest, InvalidSizeNumEntries) { urDeviceGet(platform, UR_DEVICE_TYPE_ALL, 0, devices.data(), nullptr)); } -TEST_F(urDeviceGetTest, InvalidNullPointerDevices) { +TEST_P(urDeviceGetTest, InvalidNullPointerDevices) { uint32_t count = 0; ASSERT_SUCCESS( urDeviceGet(platform, UR_DEVICE_TYPE_ALL, 0, nullptr, &count)); @@ -105,3 +70,28 @@ TEST_F(urDeviceGetTest, InvalidNullPointerDevices) { UR_RESULT_ERROR_INVALID_NULL_POINTER, urDeviceGet(platform, UR_DEVICE_TYPE_ALL, count, nullptr, nullptr)); } + +using urDeviceGetTestWithDeviceTypeParam = + uur::urPlatformTestWithParam; + +UUR_PLATFORM_TEST_SUITE_P( + urDeviceGetTestWithDeviceTypeParam, + ::testing::Values(UR_DEVICE_TYPE_DEFAULT, UR_DEVICE_TYPE_GPU, + UR_DEVICE_TYPE_CPU, UR_DEVICE_TYPE_FPGA, + UR_DEVICE_TYPE_MCA, UR_DEVICE_TYPE_VPU), + uur::platformTestWithParamPrinter); + +TEST_P(urDeviceGetTestWithDeviceTypeParam, Success) { + ur_device_type_t device_type = getParam(); + uint32_t count = 0; + ASSERT_SUCCESS(urDeviceGet(platform, device_type, 0, nullptr, &count)); + + if (count > 0) { + std::vector devices(count); + ASSERT_SUCCESS( + urDeviceGet(platform, device_type, count, devices.data(), nullptr)); + for (auto device : devices) { + ASSERT_NE(nullptr, device); + } + } +} diff --git a/test/conformance/device/urDeviceGetGlobalTimestamps.cpp b/test/conformance/device/urDeviceGetGlobalTimestamps.cpp index 8275275afe..c1182d51a4 100644 --- a/test/conformance/device/urDeviceGetGlobalTimestamps.cpp +++ b/test/conformance/device/urDeviceGetGlobalTimestamps.cpp @@ -7,6 +7,7 @@ #include #include #include +#include // WARNING - This is the precision that is used in the OpenCL-CTS. // - We might need to modify this value per-adapter. @@ -26,87 +27,93 @@ T absolute_difference(T a, T b) { return std::max(a, b) - std::min(a, b); } -using urDeviceGetGlobalTimestampTest = uur::urAllDevicesTest; - -TEST_F(urDeviceGetGlobalTimestampTest, Success) { - for (auto device : devices) { - uint64_t device_time = 0; - uint64_t host_time = 0; - ASSERT_SUCCESS( - urDeviceGetGlobalTimestamps(device, &device_time, &host_time)); - ASSERT_NE(device_time, 0); - ASSERT_NE(host_time, 0); - } +using urDeviceGetGlobalTimestampTest = uur::urDeviceTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceGetGlobalTimestampTest); + +TEST_P(urDeviceGetGlobalTimestampTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA Emulation Device"}); + + uint64_t device_time = 0; + uint64_t host_time = 0; + ASSERT_SUCCESS( + urDeviceGetGlobalTimestamps(device, &device_time, &host_time)); + ASSERT_NE(device_time, 0); + ASSERT_NE(host_time, 0); } -TEST_F(urDeviceGetGlobalTimestampTest, SuccessHostTimer) { - for (auto device : devices) { - uint64_t host_time = 0; - ASSERT_SUCCESS( - urDeviceGetGlobalTimestamps(device, nullptr, &host_time)); - ASSERT_NE(host_time, 0); - } +TEST_P(urDeviceGetGlobalTimestampTest, SuccessHostTimer) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA Emulation Device"}); + + uint64_t host_time = 0; + ASSERT_SUCCESS(urDeviceGetGlobalTimestamps(device, nullptr, &host_time)); + ASSERT_NE(host_time, 0); } -TEST_F(urDeviceGetGlobalTimestampTest, SuccessNoTimers) { - for (auto device : devices) { - ASSERT_SUCCESS(urDeviceGetGlobalTimestamps(device, nullptr, nullptr)); - } +TEST_P(urDeviceGetGlobalTimestampTest, SuccessNoTimers) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA Emulation Device"}); + + ASSERT_SUCCESS(urDeviceGetGlobalTimestamps(device, nullptr, nullptr)); } -TEST_F(urDeviceGetGlobalTimestampTest, SuccessSynchronizedTime) { - for (auto device : devices) { - // get the timer resolution of the device - size_t deviceTimerResolutionNanoSecs = 0; - ASSERT_SUCCESS(uur::GetDeviceProfilingTimerResolution( - device, deviceTimerResolutionNanoSecs)); - size_t delayAmountNanoSecs = - delayTimerMultiplier * deviceTimerResolutionNanoSecs; - - uint64_t deviceStartTime = 0, deviceEndTime = 0; - uint64_t hostStartTime = 0, hostEndTime = 0; - uint64_t hostOnlyStartTime = 0, hostOnlyEndTime = 0; - - ASSERT_SUCCESS(urDeviceGetGlobalTimestamps(device, &deviceStartTime, - &hostStartTime)); - ASSERT_SUCCESS( - urDeviceGetGlobalTimestamps(device, nullptr, &hostOnlyStartTime)); - ASSERT_NE(deviceStartTime, 0); - ASSERT_NE(hostStartTime, 0); - ASSERT_NE(hostOnlyStartTime, 0); - ASSERT_GE(hostOnlyStartTime, hostStartTime); - - // wait for timers to increment - std::this_thread::sleep_for( - std::chrono::nanoseconds(delayAmountNanoSecs)); - - ASSERT_SUCCESS( - urDeviceGetGlobalTimestamps(device, &deviceEndTime, &hostEndTime)); - ASSERT_SUCCESS( - urDeviceGetGlobalTimestamps(device, nullptr, &hostOnlyEndTime)); - ASSERT_NE(deviceEndTime, 0); - ASSERT_NE(hostEndTime, 0); - ASSERT_NE(hostOnlyEndTime, 0); - ASSERT_GE(hostOnlyEndTime, hostEndTime); - - // check that the timers have advanced - ASSERT_GT(deviceEndTime, deviceStartTime); - ASSERT_GT(hostEndTime, hostStartTime); - ASSERT_GT(hostOnlyEndTime, hostOnlyStartTime); - - // assert that the host/devices times are synchronized to some accuracy - const uint64_t deviceTimeDiff = deviceEndTime - deviceStartTime; - const uint64_t hostTimeDiff = hostEndTime - hostStartTime; - const uint64_t observedDiff = - absolute_difference(deviceTimeDiff, hostTimeDiff); - const uint64_t allowedDiff = static_cast( - std::min(deviceTimeDiff, hostTimeDiff) * allowedTimerError); - - ASSERT_LE(observedDiff, allowedDiff); - } +TEST_P(urDeviceGetGlobalTimestampTest, SuccessSynchronizedTime) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA Emulation Device"}); + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) UHD Graphics 770"}); + + // get the timer resolution of the device + size_t deviceTimerResolutionNanoSecs = 0; + ASSERT_SUCCESS(uur::GetDeviceProfilingTimerResolution( + device, deviceTimerResolutionNanoSecs)); + size_t delayAmountNanoSecs = + delayTimerMultiplier * deviceTimerResolutionNanoSecs; + + uint64_t deviceStartTime = 0, deviceEndTime = 0; + uint64_t hostStartTime = 0, hostEndTime = 0; + uint64_t hostOnlyStartTime = 0, hostOnlyEndTime = 0; + + ASSERT_SUCCESS( + urDeviceGetGlobalTimestamps(device, &deviceStartTime, &hostStartTime)); + ASSERT_SUCCESS( + urDeviceGetGlobalTimestamps(device, nullptr, &hostOnlyStartTime)); + ASSERT_NE(deviceStartTime, 0); + ASSERT_NE(hostStartTime, 0); + ASSERT_NE(hostOnlyStartTime, 0); + ASSERT_GE(hostOnlyStartTime, hostStartTime); + + // wait for timers to increment + std::this_thread::sleep_for(std::chrono::nanoseconds(delayAmountNanoSecs)); + + ASSERT_SUCCESS( + urDeviceGetGlobalTimestamps(device, &deviceEndTime, &hostEndTime)); + ASSERT_SUCCESS( + urDeviceGetGlobalTimestamps(device, nullptr, &hostOnlyEndTime)); + ASSERT_NE(deviceEndTime, 0); + ASSERT_NE(hostEndTime, 0); + ASSERT_NE(hostOnlyEndTime, 0); + ASSERT_GE(hostOnlyEndTime, hostEndTime); + + // check that the timers have advanced + ASSERT_GT(deviceEndTime, deviceStartTime); + ASSERT_GT(hostEndTime, hostStartTime); + ASSERT_GT(hostOnlyEndTime, hostOnlyStartTime); + + // assert that the host/devices times are synchronized to some accuracy + const uint64_t deviceTimeDiff = deviceEndTime - deviceStartTime; + const uint64_t hostTimeDiff = hostEndTime - hostStartTime; + const uint64_t observedDiff = + absolute_difference(deviceTimeDiff, hostTimeDiff); + const uint64_t allowedDiff = static_cast( + std::min(deviceTimeDiff, hostTimeDiff) * allowedTimerError); + + ASSERT_LE(observedDiff, allowedDiff); } -TEST_F(urDeviceGetGlobalTimestampTest, InvalidNullHandleDevice) { +TEST_P(urDeviceGetGlobalTimestampTest, InvalidNullHandleDevice) { uint64_t device_time = 0; uint64_t host_time = 0; ASSERT_EQ_RESULT( diff --git a/test/conformance/device/urDeviceGetInfo.cpp b/test/conformance/device/urDeviceGetInfo.cpp index 1fc8e6ca7f..12051056a6 100644 --- a/test/conformance/device/urDeviceGetInfo.cpp +++ b/test/conformance/device/urDeviceGetInfo.cpp @@ -4,307 +4,1763 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include #include +#include -static std::unordered_map device_info_size_map = { - {UR_DEVICE_INFO_TYPE, sizeof(ur_device_type_t)}, - {UR_DEVICE_INFO_VENDOR_ID, sizeof(uint32_t)}, - {UR_DEVICE_INFO_DEVICE_ID, sizeof(uint32_t)}, - {UR_DEVICE_INFO_MAX_COMPUTE_UNITS, sizeof(uint32_t)}, - {UR_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS, sizeof(uint32_t)}, - {UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE, sizeof(size_t)}, - {UR_DEVICE_INFO_SINGLE_FP_CONFIG, sizeof(ur_device_fp_capability_flags_t)}, - {UR_DEVICE_INFO_HALF_FP_CONFIG, sizeof(ur_device_fp_capability_flags_t)}, - {UR_DEVICE_INFO_DOUBLE_FP_CONFIG, sizeof(ur_device_fp_capability_flags_t)}, - {UR_DEVICE_INFO_QUEUE_PROPERTIES, sizeof(ur_queue_flags_t)}, - {UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_CHAR, sizeof(uint32_t)}, - {UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_SHORT, sizeof(uint32_t)}, - {UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT, sizeof(uint32_t)}, - {UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG, sizeof(uint32_t)}, - {UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT, sizeof(uint32_t)}, - {UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_DOUBLE, sizeof(uint32_t)}, - {UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF, sizeof(uint32_t)}, - {UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR, sizeof(uint32_t)}, - {UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT, sizeof(uint32_t)}, - {UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT, sizeof(uint32_t)}, - {UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG, sizeof(uint32_t)}, - {UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT, sizeof(uint32_t)}, - {UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE, sizeof(uint32_t)}, - {UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF, sizeof(uint32_t)}, - {UR_DEVICE_INFO_MAX_CLOCK_FREQUENCY, sizeof(uint32_t)}, - {UR_DEVICE_INFO_MEMORY_CLOCK_RATE, sizeof(uint32_t)}, - {UR_DEVICE_INFO_ADDRESS_BITS, sizeof(uint32_t)}, - {UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE, sizeof(uint64_t)}, - {UR_DEVICE_INFO_IMAGE_SUPPORTED, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS, sizeof(uint32_t)}, - {UR_DEVICE_INFO_MAX_WRITE_IMAGE_ARGS, sizeof(uint32_t)}, - {UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS, sizeof(uint32_t)}, - {UR_DEVICE_INFO_IMAGE2D_MAX_WIDTH, sizeof(size_t)}, - {UR_DEVICE_INFO_IMAGE2D_MAX_HEIGHT, sizeof(size_t)}, - {UR_DEVICE_INFO_IMAGE3D_MAX_WIDTH, sizeof(size_t)}, - {UR_DEVICE_INFO_IMAGE3D_MAX_HEIGHT, sizeof(size_t)}, - {UR_DEVICE_INFO_IMAGE3D_MAX_DEPTH, sizeof(size_t)}, - {UR_DEVICE_INFO_IMAGE_MAX_BUFFER_SIZE, sizeof(size_t)}, - {UR_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE, sizeof(size_t)}, - {UR_DEVICE_INFO_MAX_SAMPLERS, sizeof(uint32_t)}, - {UR_DEVICE_INFO_MAX_PARAMETER_SIZE, sizeof(size_t)}, - {UR_DEVICE_INFO_MEM_BASE_ADDR_ALIGN, sizeof(uint32_t)}, - {UR_DEVICE_INFO_GLOBAL_MEM_CACHE_TYPE, sizeof(ur_device_mem_cache_type_t)}, - {UR_DEVICE_INFO_GLOBAL_MEM_CACHELINE_SIZE, sizeof(uint32_t)}, - {UR_DEVICE_INFO_GLOBAL_MEM_CACHE_SIZE, sizeof(uint64_t)}, - {UR_DEVICE_INFO_GLOBAL_MEM_SIZE, sizeof(uint64_t)}, - {UR_DEVICE_INFO_GLOBAL_MEM_FREE, sizeof(uint64_t)}, - {UR_DEVICE_INFO_MAX_CONSTANT_BUFFER_SIZE, sizeof(uint64_t)}, - {UR_DEVICE_INFO_MAX_CONSTANT_ARGS, sizeof(uint32_t)}, - {UR_DEVICE_INFO_LOCAL_MEM_TYPE, sizeof(ur_device_local_mem_type_t)}, - {UR_DEVICE_INFO_LOCAL_MEM_SIZE, sizeof(uint64_t)}, - {UR_DEVICE_INFO_ERROR_CORRECTION_SUPPORT, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_HOST_UNIFIED_MEMORY, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION, sizeof(size_t)}, - {UR_DEVICE_INFO_ENDIAN_LITTLE, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_AVAILABLE, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_COMPILER_AVAILABLE, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_LINKER_AVAILABLE, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_EXECUTION_CAPABILITIES, - sizeof(ur_device_exec_capability_flags_t)}, - {UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES, sizeof(ur_queue_flags_t)}, - {UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES, sizeof(ur_queue_flags_t)}, - {UR_DEVICE_INFO_PLATFORM, sizeof(ur_platform_handle_t)}, - {UR_DEVICE_INFO_REFERENCE_COUNT, sizeof(uint32_t)}, - {UR_DEVICE_INFO_PRINTF_BUFFER_SIZE, sizeof(size_t)}, - {UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_PARENT_DEVICE, sizeof(ur_device_handle_t)}, - {UR_DEVICE_INFO_PARTITION_MAX_SUB_DEVICES, sizeof(uint32_t)}, - {UR_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN, - sizeof(ur_device_affinity_domain_flags_t)}, - {UR_DEVICE_INFO_MAX_NUM_SUB_GROUPS, sizeof(uint32_t)}, - {UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_USM_HOST_SUPPORT, - sizeof(ur_device_usm_access_capability_flags_t)}, - {UR_DEVICE_INFO_USM_DEVICE_SUPPORT, - sizeof(ur_device_usm_access_capability_flags_t)}, - {UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT, - sizeof(ur_device_usm_access_capability_flags_t)}, - {UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT, - sizeof(ur_device_usm_access_capability_flags_t)}, - {UR_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT, - sizeof(ur_device_usm_access_capability_flags_t)}, - {UR_DEVICE_INFO_GPU_EU_COUNT, sizeof(uint32_t)}, - {UR_DEVICE_INFO_GPU_EU_SIMD_WIDTH, sizeof(uint32_t)}, - {UR_DEVICE_INFO_GPU_EU_SLICES, sizeof(uint32_t)}, - {UR_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE, sizeof(uint32_t)}, - {UR_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE, sizeof(uint32_t)}, - {UR_DEVICE_INFO_GPU_HW_THREADS_PER_EU, sizeof(uint32_t)}, - {UR_DEVICE_INFO_MAX_MEMORY_BANDWIDTH, sizeof(uint32_t)}, - {UR_DEVICE_INFO_IMAGE_SRGB, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_BUILD_ON_SUBDEVICE, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_ATOMIC_64, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES, - sizeof(ur_memory_order_capability_flags_t)}, - {UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES, - sizeof(ur_memory_scope_capability_flags_t)}, - {UR_DEVICE_INFO_BFLOAT16, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES, sizeof(uint32_t)}, - {UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_MEMORY_BUS_WIDTH, sizeof(uint32_t)}, - {UR_DEVICE_INFO_MAX_WORK_GROUPS_3D, sizeof(size_t[3])}, - {UR_DEVICE_INFO_ASYNC_BARRIER, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP, sizeof(uint32_t)}, - {UR_DEVICE_INFO_COMPONENT_DEVICES, sizeof(uint32_t)}, - {UR_DEVICE_INFO_COMPOSITE_DEVICE, sizeof(ur_device_handle_t)}, - {UR_DEVICE_INFO_USM_POOL_SUPPORT, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP, - sizeof(ur_exp_device_2d_block_array_capability_flags_t)}, - {UR_DEVICE_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES, - sizeof(ur_memory_order_capability_flags_t)}, - {UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES, - sizeof(ur_memory_scope_capability_flags_t)}, - {UR_DEVICE_INFO_ESIMD_SUPPORT, sizeof(ur_bool_t)}, - {UR_DEVICE_INFO_IP_VERSION, sizeof(uint32_t)}, - {UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT, sizeof(ur_bool_t)}}; - -struct urDeviceGetInfoTest : uur::urAllDevicesTest, - ::testing::WithParamInterface { - - void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(uur::urAllDevicesTest::SetUp()); - } -}; - -INSTANTIATE_TEST_SUITE_P( - , urDeviceGetInfoTest, - ::testing::Values( - - UR_DEVICE_INFO_TYPE, - UR_DEVICE_INFO_VENDOR_ID, // - UR_DEVICE_INFO_DEVICE_ID, // - UR_DEVICE_INFO_MAX_COMPUTE_UNITS, // - UR_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS, // - UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES, // - UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE, // - UR_DEVICE_INFO_SINGLE_FP_CONFIG, // - UR_DEVICE_INFO_HALF_FP_CONFIG, // - UR_DEVICE_INFO_DOUBLE_FP_CONFIG, // - UR_DEVICE_INFO_QUEUE_PROPERTIES, // - UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_CHAR, // - UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_SHORT, // - UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG, // - UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT, // - UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR, // - UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT, // - UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT, // - UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG, // - UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT, // - UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE, // - UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF, // - UR_DEVICE_INFO_MAX_CLOCK_FREQUENCY, // - UR_DEVICE_INFO_MEMORY_CLOCK_RATE, // - UR_DEVICE_INFO_ADDRESS_BITS, // - UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE, // - UR_DEVICE_INFO_IMAGE_SUPPORTED, // - UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS, // - UR_DEVICE_INFO_MAX_WRITE_IMAGE_ARGS, // - UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS, // - UR_DEVICE_INFO_IMAGE2D_MAX_WIDTH, // - UR_DEVICE_INFO_IMAGE2D_MAX_HEIGHT, // - UR_DEVICE_INFO_IMAGE3D_MAX_WIDTH, // - UR_DEVICE_INFO_IMAGE3D_MAX_HEIGHT, // - UR_DEVICE_INFO_IMAGE3D_MAX_DEPTH, // - UR_DEVICE_INFO_IMAGE_MAX_BUFFER_SIZE, // - UR_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE, // - UR_DEVICE_INFO_MAX_SAMPLERS, // - UR_DEVICE_INFO_MAX_PARAMETER_SIZE, // - UR_DEVICE_INFO_MEM_BASE_ADDR_ALIGN, // - UR_DEVICE_INFO_GLOBAL_MEM_CACHE_TYPE, // - UR_DEVICE_INFO_GLOBAL_MEM_CACHELINE_SIZE, // - UR_DEVICE_INFO_GLOBAL_MEM_CACHE_SIZE, // - UR_DEVICE_INFO_GLOBAL_MEM_SIZE, // - UR_DEVICE_INFO_GLOBAL_MEM_FREE, // - UR_DEVICE_INFO_MAX_CONSTANT_BUFFER_SIZE, // - UR_DEVICE_INFO_MAX_CONSTANT_ARGS, // - UR_DEVICE_INFO_LOCAL_MEM_TYPE, // - UR_DEVICE_INFO_LOCAL_MEM_SIZE, // - UR_DEVICE_INFO_ERROR_CORRECTION_SUPPORT, // - UR_DEVICE_INFO_HOST_UNIFIED_MEMORY, // - UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION, // - UR_DEVICE_INFO_ENDIAN_LITTLE, // - UR_DEVICE_INFO_AVAILABLE, // - UR_DEVICE_INFO_COMPILER_AVAILABLE, // - UR_DEVICE_INFO_LINKER_AVAILABLE, // - UR_DEVICE_INFO_EXECUTION_CAPABILITIES, // - UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES, // - UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES, // - UR_DEVICE_INFO_BUILT_IN_KERNELS, // - UR_DEVICE_INFO_PLATFORM, // - UR_DEVICE_INFO_REFERENCE_COUNT, // - UR_DEVICE_INFO_IL_VERSION, // - UR_DEVICE_INFO_NAME, // - UR_DEVICE_INFO_VENDOR, // - UR_DEVICE_INFO_DRIVER_VERSION, // - UR_DEVICE_INFO_PROFILE, // - UR_DEVICE_INFO_VERSION, // - UR_DEVICE_INFO_BACKEND_RUNTIME_VERSION, // - UR_DEVICE_INFO_EXTENSIONS, // - UR_DEVICE_INFO_PRINTF_BUFFER_SIZE, // - UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC, // - UR_DEVICE_INFO_PARENT_DEVICE, // - UR_DEVICE_INFO_SUPPORTED_PARTITIONS, // - UR_DEVICE_INFO_PARTITION_MAX_SUB_DEVICES, // - UR_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN, // - UR_DEVICE_INFO_PARTITION_TYPE, // - UR_DEVICE_INFO_MAX_NUM_SUB_GROUPS, // - UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS, // - UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL, // - UR_DEVICE_INFO_USM_HOST_SUPPORT, // - UR_DEVICE_INFO_USM_DEVICE_SUPPORT, // - UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT, // - UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT, // - UR_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT, // - UR_DEVICE_INFO_UUID, // - UR_DEVICE_INFO_PCI_ADDRESS, // - UR_DEVICE_INFO_GPU_EU_COUNT, // - UR_DEVICE_INFO_GPU_EU_SIMD_WIDTH, // - UR_DEVICE_INFO_GPU_EU_SLICES, // - UR_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE, // - UR_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE, // - UR_DEVICE_INFO_GPU_HW_THREADS_PER_EU, // - UR_DEVICE_INFO_MAX_MEMORY_BANDWIDTH, // - UR_DEVICE_INFO_IMAGE_SRGB, // - UR_DEVICE_INFO_BUILD_ON_SUBDEVICE, // - UR_DEVICE_INFO_ATOMIC_64, // - UR_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES, // - UR_DEVICE_INFO_BFLOAT16, // - UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES, // - UR_DEVICE_INFO_MEMORY_BUS_WIDTH, // - UR_DEVICE_INFO_MAX_WORK_GROUPS_3D, // - UR_DEVICE_INFO_ASYNC_BARRIER, // - UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT, // - UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED, // - UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP, // - UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT, // - UR_DEVICE_INFO_USM_POOL_SUPPORT, // - UR_DEVICE_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES, // - UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES, // - UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES, // - UR_DEVICE_INFO_IP_VERSION, // - UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS, // - UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP, // - UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_DOUBLE, // - UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF, // - UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT // - ), - [](const ::testing::TestParamInfo &info) { - std::stringstream ss; - ss << info.param; - return ss.str(); - }); - -struct urDeviceGetInfoSingleTest : uur::urAllDevicesTest { - void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(uur::urAllDevicesTest::SetUp()); +using urDeviceGetInfoTest = uur::urDeviceTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceGetInfoTest); + +TEST_P(urDeviceGetInfoTest, SuccessDeviceType) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_TYPE; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_type_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast(info_data.data()); + ASSERT_GE(*returned_data, UR_DEVICE_TYPE_DEFAULT); + ASSERT_LT(*returned_data, UR_DEVICE_TYPE_FORCE_UINT32); +} + +TEST_P(urDeviceGetInfoTest, SuccessVendorId) { + size_t size = 0; + + ASSERT_SUCCESS( + urDeviceGetInfo(device, UR_DEVICE_INFO_VENDOR_ID, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessDeviceId) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_DEVICE_ID; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, info_type, 0, nullptr, &size), + UR_DEVICE_INFO_DEVICE_ID); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = reinterpret_cast(info_data.data()); + ASSERT_GT(*returned_data, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxComputeUnits) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_COMPUTE_UNITS, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxWorkItemDimensions) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxWorkItemSizes) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + + size_t max_dimensions = 0; + urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS, + sizeof(max_dimensions), &max_dimensions, nullptr); + + std::vector max_work_item_sizes(max_dimensions); + urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES, + max_dimensions * sizeof(size_t), max_work_item_sizes.data(), + nullptr); + + size_t returned_size = 0; + urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES, 0, nullptr, + &returned_size); + + EXPECT_EQ(returned_size, max_dimensions * sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxWorkGroupSize) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessSingleFPConfig) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_SINGLE_FP_CONFIG; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_fp_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_data & UR_DEVICE_FP_CAPABILITY_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessHalfFPConfig) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_HALF_FP_CONFIG; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_fp_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_data & UR_DEVICE_FP_CAPABILITY_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessDoubleFPConfig) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_DOUBLE_FP_CONFIG; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_fp_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_data & UR_DEVICE_FP_CAPABILITY_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessQueueProperties) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_QUEUE_PROPERTIES; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_queue_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_data & UR_QUEUE_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessPreferredVectorWidthChar) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_CHAR, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessPreferredVectorWidthShort) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, + UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_SHORT, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessPreferredVectorWidthInt) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessPreferredVectorWidthLong) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessPreferredVectorWidthFloat) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, + UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessPreferredVectorWidthDouble) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, + UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_DOUBLE, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessPreferredVectorWidthHalf) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessNativeVectorWidthChar) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessNativeVectorWidthShort) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessNativeVectorWidthInt) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessNativeVectorWidthLong) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessNativeVectorWidthFloat) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessNativeVectorWidthDouble) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessNativeVectorWidthHalf) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxClockFrequency) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_CLOCK_FREQUENCY, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMemoryClockRate) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_MEMORY_CLOCK_RATE, 0, nullptr, + &size), + UR_DEVICE_INFO_MEMORY_CLOCK_RATE); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessAddressBits) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_ADDRESS_BITS, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxMemAllocSize) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint64_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessImageSupported) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_IMAGE_SUPPORT, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxReadImageArgs) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxWriteImageArgs) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_WRITE_IMAGE_ARGS, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxReadWriteImageArgs) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessImage2DMaxWidth) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_IMAGE2D_MAX_WIDTH, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessImage2DMaxHeight) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_IMAGE2D_MAX_HEIGHT, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessImage3DMaxWidth) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_IMAGE3D_MAX_WIDTH, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessImage3DMaxHeight) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_IMAGE3D_MAX_HEIGHT, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessImage3DMaxDepth) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_IMAGE3D_MAX_DEPTH, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessImageMaxBufferSize) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_IMAGE_MAX_BUFFER_SIZE, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessImageMaxArraySize) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxSamplers) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_SAMPLERS, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxParameterSize) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_PARAMETER_SIZE, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMemoryBaseAddressAlignment) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MEM_BASE_ADDR_ALIGN, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessGlobalMemoryCacheType) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_GLOBAL_MEM_CACHE_TYPE; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_mem_cache_type_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast(info_data.data()); + ASSERT_GE(*returned_data, UR_DEVICE_MEM_CACHE_TYPE_NONE); + ASSERT_LT(*returned_data, UR_DEVICE_MEM_CACHE_TYPE_FORCE_UINT32); +} + +TEST_P(urDeviceGetInfoTest, SuccessGlobalMemoryCacheLineSize) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_GLOBAL_MEM_CACHELINE_SIZE, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessGlobalMemoryCacheSize) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_GLOBAL_MEM_CACHE_SIZE, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint64_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessGlobalMemorySize) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_GLOBAL_MEM_SIZE, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint64_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessGlobalMemoryFreeSize) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_GLOBAL_MEM_FREE, 0, nullptr, + &size), + UR_DEVICE_INFO_GLOBAL_MEM_FREE); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint64_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxConstantBufferSize) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_MAX_CONSTANT_BUFFER_SIZE, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint64_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxConstantArgs) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_CONSTANT_ARGS, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessLocalMemoryType) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_LOCAL_MEM_TYPE; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_local_mem_type_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast(info_data.data()); + ASSERT_GE(*returned_data, UR_DEVICE_LOCAL_MEM_TYPE_NONE); + ASSERT_LT(*returned_data, UR_DEVICE_LOCAL_MEM_TYPE_FORCE_UINT32); +} + +TEST_P(urDeviceGetInfoTest, SuccessLocalMemorySize) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_LOCAL_MEM_SIZE, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint64_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessErrorCorrectionSupport) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_ERROR_CORRECTION_SUPPORT, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessHostUnifiedMemory) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_HOST_UNIFIED_MEMORY, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessProfilingTimerResolution) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessEndianLittle) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_ENDIAN_LITTLE, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessAvailable) { + size_t size = 0; + + ASSERT_SUCCESS( + urDeviceGetInfo(device, UR_DEVICE_INFO_AVAILABLE, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessCompilerAvailable) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_COMPILER_AVAILABLE, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessLinkerAvailable) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_LINKER_AVAILABLE, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessExecutionCapabilities) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_EXECUTION_CAPABILITIES; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_exec_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_data & UR_DEVICE_EXEC_CAPABILITY_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessQueueOnDeviceProperties) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + size_t size = 0; + const ur_device_info_t info_type = + UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_queue_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_data & UR_QUEUE_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessQueueOnHostProperties) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_queue_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_data & UR_QUEUE_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessBuiltInKernels) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_BUILT_IN_KERNELS; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_GT(size, 0); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + EXPECT_EQ(info_data[size - 1], '\0'); +} + +TEST_P(urDeviceGetInfoTest, SuccessPlatform) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_PLATFORM; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_platform_handle_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_data, platform); +} + +TEST_P(urDeviceGetInfoTest, SuccessReferenceCount) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_REFERENCE_COUNT, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessILVersion) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_IL_VERSION; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_GT(size, 0); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + EXPECT_EQ(info_data[size - 1], '\0'); +} + +TEST_P(urDeviceGetInfoTest, SuccessName) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_NAME; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_GT(size, 0); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + EXPECT_EQ(info_data[size - 1], '\0'); +} + +TEST_P(urDeviceGetInfoTest, SuccessVendor) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_VENDOR; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_GT(size, 0); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + EXPECT_EQ(info_data[size - 1], '\0'); +} + +TEST_P(urDeviceGetInfoTest, SuccessDriverVersion) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_DRIVER_VERSION; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_GT(size, 0); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + EXPECT_EQ(info_data[size - 1], '\0'); +} + +TEST_P(urDeviceGetInfoTest, SuccessProfile) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_PROFILE; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_GT(size, 0); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + EXPECT_EQ(info_data[size - 1], '\0'); +} + +TEST_P(urDeviceGetInfoTest, SuccessVersion) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_VERSION; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_GT(size, 0); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + EXPECT_EQ(info_data[size - 1], '\0'); +} + +TEST_P(urDeviceGetInfoTest, SuccessBackendRuntimeVersion) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_BACKEND_RUNTIME_VERSION; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_GT(size, 0); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + EXPECT_EQ(info_data[size - 1], '\0'); +} + +TEST_P(urDeviceGetInfoTest, SuccessExtensions) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_EXTENSIONS; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_GT(size, 0); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + EXPECT_EQ(info_data[size - 1], '\0'); +} + +TEST_P(urDeviceGetInfoTest, SuccessPrintfBufferSize) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_PRINTF_BUFFER_SIZE, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessPreferredInteropUserSync) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessParentDevice) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_PARENT_DEVICE, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_handle_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessSupportedPartitions) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_SUPPORTED_PARTITIONS; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + + if (size > 0) { + size_t num_partitions = size / sizeof(ur_device_partition_t); + std::vector partitions(num_partitions); + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, size, + partitions.data(), nullptr)); + + for (const auto &partition : partitions) { + EXPECT_GE(partition, UR_DEVICE_PARTITION_EQUALLY); + EXPECT_LT(partition, UR_DEVICE_PARTITION_FORCE_UINT32); + } + } else { + ASSERT_EQ(size, 0); } -}; +} + +TEST_P(urDeviceGetInfoTest, SuccessPartitionMaxSubDevices) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_PARTITION_MAX_SUB_DEVICES, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} -bool doesReturnArray(ur_device_info_t info_type) { - if (info_type == UR_DEVICE_INFO_SUPPORTED_PARTITIONS || - info_type == UR_DEVICE_INFO_PARTITION_TYPE) { - return true; - } - return false; +TEST_P(urDeviceGetInfoTest, SuccessPartitionAffinityDomain) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_affinity_domain_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_data & UR_DEVICE_AFFINITY_DOMAIN_FLAGS_MASK, 0); } -TEST_P(urDeviceGetInfoTest, Success) { - ur_device_info_t info_type = GetParam(); - for (auto device : devices) { - size_t size = 0; - ASSERT_SUCCESS_OR_OPTIONAL_QUERY( - urDeviceGetInfo(device, info_type, 0, nullptr, &size), info_type); +TEST_P(urDeviceGetInfoTest, SuccessPartitionType) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_PARTITION_TYPE; - if (doesReturnArray(info_type) && size == 0) { - return; - } - ASSERT_NE(size, 0); + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); - if (const auto expected_size = device_info_size_map.find(info_type); - expected_size != device_info_size_map.end()) { - ASSERT_EQ(expected_size->second, size); - } + if (size > 0) { + size_t num_properties = size / sizeof(ur_device_partition_property_t); + std::vector properties(num_properties); - std::vector info_data(size); ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, size, - info_data.data(), nullptr)); + properties.data(), nullptr)); - if (info_type == UR_DEVICE_INFO_PLATFORM) { - auto returned_platform = - reinterpret_cast(info_data.data()); - ASSERT_EQ(*returned_platform, platform); + for (const auto prop : properties) { + ASSERT_GE(prop.type, UR_DEVICE_PARTITION_EQUALLY); + ASSERT_LE(prop.type, UR_DEVICE_PARTITION_FORCE_UINT32); } + } else { + ASSERT_EQ(size, 0); } } -TEST_F(urDeviceGetInfoSingleTest, InvalidNullHandleDevice) { +TEST_P(urDeviceGetInfoTest, SuccessMaxSubGroups) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_NUM_SUB_GROUPS, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessSubGroupIndependentForwardProgress) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessSubGroupSizesIntel) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size % sizeof(uint32_t), 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessUSMHostSupport) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_USM_HOST_SUPPORT; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_usm_access_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast( + info_data.data()); + ASSERT_EQ(*returned_data & UR_DEVICE_USM_ACCESS_CAPABILITY_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessUSMDeviceSupport) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_USM_DEVICE_SUPPORT; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_usm_access_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast( + info_data.data()); + ASSERT_EQ(*returned_data & UR_DEVICE_USM_ACCESS_CAPABILITY_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessUSMSingleSharedSupport) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_usm_access_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast( + info_data.data()); + ASSERT_EQ(*returned_data & UR_DEVICE_USM_ACCESS_CAPABILITY_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessUSMCrossSharedSupport) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_usm_access_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast( + info_data.data()); + ASSERT_EQ(*returned_data & UR_DEVICE_USM_ACCESS_CAPABILITY_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessUSMSystemSharedSupport) { + size_t size = 0; + const ur_device_info_t info_type = UR_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_usm_access_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast( + info_data.data()); + ASSERT_EQ(*returned_data & UR_DEVICE_USM_ACCESS_CAPABILITY_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessUUID) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_UUID, 0, nullptr, &size), + UR_DEVICE_INFO_UUID); + ASSERT_NE(size, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessPCIAddress) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_PCI_ADDRESS, 0, nullptr, &size), + UR_DEVICE_INFO_PCI_ADDRESS); + ASSERT_NE(size, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessIntelGPUEUCount) { + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_GPU_EU_COUNT, 0, nullptr, &size), + UR_DEVICE_INFO_GPU_EU_COUNT); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessIntelGPUEUSIMDWidth) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_GPU_EU_SIMD_WIDTH, 0, nullptr, + &size), + UR_DEVICE_INFO_GPU_EU_SIMD_WIDTH); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessIntelGPUEUSlices) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_GPU_EU_SLICES, 0, nullptr, + &size), + UR_DEVICE_INFO_GPU_EU_SLICES); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessIntelGPUEUCountPerSlice) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE, 0, + nullptr, &size), + UR_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessIntelGPUSubslicesPerSplice) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE, 0, + nullptr, &size), + UR_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessIntelGPUHWThreadsPerEU) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_GPU_HW_THREADS_PER_EU, 0, + nullptr, &size), + UR_DEVICE_INFO_GPU_HW_THREADS_PER_EU); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessIntelMaxMemoryBandwidth) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_MEMORY_BANDWIDTH, 0, nullptr, + &size), + UR_DEVICE_INFO_MAX_MEMORY_BANDWIDTH); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessImageSRGB) { + size_t size = 0; + + ASSERT_SUCCESS( + urDeviceGetInfo(device, UR_DEVICE_INFO_IMAGE_SRGB, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessAtomic64) { + size_t size = 0; + + ASSERT_SUCCESS( + urDeviceGetInfo(device, UR_DEVICE_INFO_ATOMIC_64, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessAtomicMemoryOrderCapabilities) { + size_t size = 0; + ur_device_info_t info_type = + UR_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_memory_order_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast( + info_data.data()); + ASSERT_EQ(*returned_data & UR_MEMORY_ORDER_CAPABILITY_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessAtomicMemoryScopeCapabilities) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + ur_device_info_t info_type = + UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_memory_scope_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast( + info_data.data()); + ASSERT_EQ(*returned_data & UR_MEMORY_SCOPE_CAPABILITY_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessAtomicFenceOrderCapabilities) { + size_t size = 0; + const ur_device_info_t info_type = + UR_DEVICE_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_memory_order_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast( + info_data.data()); + ASSERT_EQ(*returned_data & UR_MEMORY_ORDER_CAPABILITY_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessAtomicFenceScopeCapabilities) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + const ur_device_info_t info_type = + UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES; + + ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_memory_scope_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast( + info_data.data()); + ASSERT_EQ(*returned_data & UR_MEMORY_SCOPE_CAPABILITY_FLAGS_MASK, 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessBFloat64) { + size_t size = 0; + + ASSERT_SUCCESS( + urDeviceGetInfo(device, UR_DEVICE_INFO_BFLOAT16, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxComputeQueueIndices) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessKernelSetSpecializationConstants) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS, 0, nullptr, + &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMemoryBusWidth) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_MEMORY_BUS_WIDTH, 0, nullptr, + &size), + UR_DEVICE_INFO_MEMORY_BUS_WIDTH); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxWorkGroups3D) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_WORK_GROUPS_3D, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t) * 3); +} + +TEST_P(urDeviceGetInfoTest, SuccessAsyncBarrier) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_ASYNC_BARRIER, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMemoryChannelSupport) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessHostPipeReadWriteSupport) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, + UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORT, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxRegistersPerWorkGroup) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP, 0, + nullptr, &size), + UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessIPVersion) { + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_IP_VERSION, 0, nullptr, &size), + UR_DEVICE_INFO_IP_VERSION); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessVirtualMemorySupported) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessESIMDSupported) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_ESIMD_SUPPORT, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessComponentDevices) { + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_COMPONENT_DEVICES, 0, nullptr, + &size), + UR_DEVICE_INFO_COMPONENT_DEVICES); + ASSERT_NE(size, 0); + ASSERT_EQ(size % sizeof(ur_device_handle_t), 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessCompositeDevice) { + size_t size = 0; + + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( + urDeviceGetInfo(device, UR_DEVICE_INFO_COMPOSITE_DEVICE, 0, nullptr, + &size), + UR_DEVICE_INFO_COMPOSITE_DEVICE); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_handle_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessGlobalVariableSupport) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessUSMPoolSupport) { + size_t size = 0; + + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_USM_POOL_SUPPORT, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessCommandBufferSupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessCommandBufferUpdateCapabilities) { + size_t size = 0; + const ur_device_info_t info_type = + UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_CAPABILITIES_EXP; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_device_command_buffer_update_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast( + info_data.data()); + ASSERT_EQ(*returned_data & + UR_DEVICE_COMMAND_BUFFER_UPDATE_CAPABILITY_FLAGS_MASK, + 0); +} + +TEST_P(urDeviceGetInfoTest, SuccessCommandBufferEventSupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceGetInfo(device, UR_DEVICE_INFO_COMMAND_BUFFER_EVENT_SUPPORT_EXP, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessClusterLaunch) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_CLUSTER_LAUNCH_SUPPORT_EXP, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessBindlessImagesSupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessBindlessImagesSharedUSMSupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_BINDLESS_IMAGES_SHARED_USM_SUPPORT_EXP, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessBindlessImagesShared1DUSMSupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_BINDLESS_IMAGES_1D_USM_SUPPORT_EXP, 0, nullptr, + &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessBindlessImagesShared2DUSMSupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_BINDLESS_IMAGES_2D_USM_SUPPORT_EXP, 0, nullptr, + &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessImagePitchAlign) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxImageLinearWidth) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxImageLinearHeight) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_MAX_IMAGE_LINEAR_HEIGHT_EXP, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMaxImageLinearPitch) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_MAX_IMAGE_LINEAR_PITCH_EXP, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(size_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMipMapSupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_MIPMAP_SUPPORT_EXP, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMipMapAnisotropySupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceGetInfo(device, UR_DEVICE_INFO_MIPMAP_ANISOTROPY_SUPPORT_EXP, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMipMapMaxAnisotropy) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_MIPMAP_MAX_ANISOTROPY_EXP, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(uint32_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessMipMapLevelReferenceSupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP, 0, nullptr, + &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessExternalMemoryImportSupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_EXTERNAL_MEMORY_IMPORT_SUPPORT_EXP, 0, nullptr, + &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessExternalSemaphoreImportSupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_EXTERNAL_SEMAPHORE_IMPORT_SUPPORT_EXP, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessCubemapSupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_CUBEMAP_SUPPORT_EXP, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessCubemapSeamlessFilteringSupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_CUBEMAP_SEAMLESS_FILTERING_SUPPORT_EXP, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessBindlessSampledImageFetch1DUSM) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_SUPPORT_EXP, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessBindlessSampledImageFetch1D) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_SUPPORT_EXP, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessBindlessSampledImageFetch2DUSM) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_SUPPORT_EXP, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessBindlessSampledImageFetch2D) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_SUPPORT_EXP, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessBindlessSampledImageFetch3D) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_SUPPORT_EXP, 0, + nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessTimestampRecordingSupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceGetInfo(device, UR_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT_EXP, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessImageArraySupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_IMAGE_ARRAY_SUPPORT_EXP, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessBindlessUniqueAddressingPerDim) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_SUPPORT_EXP, + 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessBindlessSample1DUSM) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_SUPPORT_EXP, 0, nullptr, + &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessBindlessSample2DUSM) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_SUPPORT_EXP, 0, nullptr, + &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, SuccessEnqueueNativeCommandSupport) { + size_t size = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceGetInfo( + device, UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP, 0, nullptr, + &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_bool_t)); +} + +TEST_P(urDeviceGetInfoTest, Success2DBlockArrayCapabilities) { + size_t size = 0; + const ur_device_info_t info_type = + UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urDeviceGetInfo(device, info_type, 0, nullptr, &size)); + ASSERT_NE(size, 0); + ASSERT_EQ(size, sizeof(ur_exp_device_2d_block_array_capability_flags_t)); + + std::vector info_data(size); + ASSERT_SUCCESS( + urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + const auto returned_data = + reinterpret_cast( + info_data.data()); + ASSERT_EQ(*returned_data & + UR_DEVICE_COMMAND_BUFFER_UPDATE_CAPABILITY_FLAGS_MASK, + 0); +} + +TEST_P(urDeviceGetInfoTest, InvalidNullHandleDevice) { ur_device_type_t device_type; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, urDeviceGetInfo(nullptr, UR_DEVICE_INFO_TYPE, @@ -312,69 +1768,56 @@ TEST_F(urDeviceGetInfoSingleTest, InvalidNullHandleDevice) { nullptr)); } -TEST_F(urDeviceGetInfoSingleTest, InvalidEnumerationInfoType) { - for (auto device : devices) { - ur_device_type_t device_type; - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_ENUMERATION, - urDeviceGetInfo(device, UR_DEVICE_INFO_FORCE_UINT32, - sizeof(ur_device_type_t), &device_type, - nullptr)); - } +TEST_P(urDeviceGetInfoTest, InvalidEnumerationInfoType) { + ur_device_type_t device_type; + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_ENUMERATION, + urDeviceGetInfo(device, UR_DEVICE_INFO_FORCE_UINT32, + sizeof(ur_device_type_t), &device_type, + nullptr)); } -TEST_F(urDeviceGetInfoSingleTest, InvalidSizePropSize) { - for (auto device : devices) { - ur_device_type_t device_type; - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, - urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, 0, - &device_type, nullptr)); - } +TEST_P(urDeviceGetInfoTest, InvalidSizePropSize) { + ur_device_type_t device_type; + ASSERT_EQ_RESULT( + UR_RESULT_ERROR_INVALID_SIZE, + urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, 0, &device_type, nullptr)); } -TEST_F(urDeviceGetInfoSingleTest, InvalidSizePropSizeSmall) { - for (auto device : devices) { - ur_device_type_t device_type; - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, - urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, - sizeof(device_type) - 1, &device_type, - nullptr)); - } +TEST_P(urDeviceGetInfoTest, InvalidSizePropSizeSmall) { + ur_device_type_t device_type; + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, + urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, + sizeof(device_type) - 1, &device_type, + nullptr)); } -TEST_F(urDeviceGetInfoSingleTest, InvalidNullPointerPropValue) { - for (auto device : devices) { - ur_device_type_t device_type; - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, - sizeof(device_type), nullptr, - nullptr)); - } +TEST_P(urDeviceGetInfoTest, InvalidNullPointerPropValue) { + ur_device_type_t device_type; + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, + sizeof(device_type), nullptr, nullptr)); } -TEST_F(urDeviceGetInfoSingleTest, InvalidNullPointerPropSizeRet) { - for (auto device : devices) { - ASSERT_EQ_RESULT( - UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, 0, nullptr, nullptr)); - } +TEST_P(urDeviceGetInfoTest, InvalidNullPointerPropSizeRet) { + ASSERT_EQ_RESULT( + UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDeviceGetInfo(device, UR_DEVICE_INFO_TYPE, 0, nullptr, nullptr)); } -TEST_F(urDeviceGetInfoSingleTest, MaxWorkGroupSizeIsNonzero) { - for (auto device : devices) { - size_t max_global_size; +TEST_P(urDeviceGetInfoTest, MaxWorkGroupSizeIsNonzero) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); - ASSERT_SUCCESS( - urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE, - sizeof(size_t), &max_global_size, nullptr)); - ASSERT_NE(max_global_size, 0); + size_t max_global_size; - std::array max_work_group_sizes; - ASSERT_SUCCESS(urDeviceGetInfo(device, - UR_DEVICE_INFO_MAX_WORK_GROUPS_3D, - sizeof(max_work_group_sizes), - max_work_group_sizes.data(), nullptr)); - for (size_t i = 0; i < 3; i++) { - ASSERT_NE(max_work_group_sizes[i], 0); - } + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE, + sizeof(size_t), &max_global_size, nullptr)); + ASSERT_NE(max_global_size, 0); + + std::array max_work_group_sizes; + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_MAX_WORK_GROUPS_3D, + sizeof(max_work_group_sizes), + max_work_group_sizes.data(), nullptr)); + for (size_t i = 0; i < 3; i++) { + ASSERT_NE(max_work_group_sizes[i], 0); } } diff --git a/test/conformance/device/urDeviceGetNativeHandle.cpp b/test/conformance/device/urDeviceGetNativeHandle.cpp index f6c8963681..6532c74545 100644 --- a/test/conformance/device/urDeviceGetNativeHandle.cpp +++ b/test/conformance/device/urDeviceGetNativeHandle.cpp @@ -4,26 +4,23 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -using urDeviceGetNativeHandleTest = uur::urAllDevicesTest; +using urDeviceGetNativeHandleTest = uur::urDeviceTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceGetNativeHandleTest); -TEST_F(urDeviceGetNativeHandleTest, Success) { - for (auto device : devices) { - ur_native_handle_t native_handle = 0; - if (auto error = urDeviceGetNativeHandle(device, &native_handle)) { - ASSERT_EQ_RESULT(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, error); - } +TEST_P(urDeviceGetNativeHandleTest, Success) { + ur_native_handle_t native_handle = 0; + if (auto error = urDeviceGetNativeHandle(device, &native_handle)) { + ASSERT_EQ_RESULT(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, error); } } -TEST_F(urDeviceGetNativeHandleTest, InvalidNullHandleDevice) { +TEST_P(urDeviceGetNativeHandleTest, InvalidNullHandleDevice) { ur_native_handle_t native_handle = 0; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, urDeviceGetNativeHandle(nullptr, &native_handle)); } -TEST_F(urDeviceGetNativeHandleTest, InvalidNullPointerNativeDevice) { - for (auto device : devices) { - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDeviceGetNativeHandle(device, nullptr)); - } +TEST_P(urDeviceGetNativeHandleTest, InvalidNullPointerNativeDevice) { + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDeviceGetNativeHandle(device, nullptr)); } diff --git a/test/conformance/device/urDeviceGetSelected.cpp b/test/conformance/device/urDeviceGetSelected.cpp index 953b418e24..2099d226c4 100644 --- a/test/conformance/device/urDeviceGetSelected.cpp +++ b/test/conformance/device/urDeviceGetSelected.cpp @@ -7,10 +7,11 @@ #include using urDeviceGetSelectedTest = uur::urPlatformTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urDeviceGetSelectedTest); /* adpater agnostic tests -- none assume the existence or support of any specific adapter */ -TEST_F(urDeviceGetSelectedTest, Success) { +TEST_P(urDeviceGetSelectedTest, Success) { unsetenv("ONEAPI_DEVICE_SELECTOR"); uint32_t count = 0; ASSERT_SUCCESS( @@ -24,7 +25,7 @@ TEST_F(urDeviceGetSelectedTest, Success) { } } -TEST_F(urDeviceGetSelectedTest, SuccessSubsetOfDevices) { +TEST_P(urDeviceGetSelectedTest, SuccessSubsetOfDevices) { unsetenv("ONEAPI_DEVICE_SELECTOR"); uint32_t count = 0; ASSERT_SUCCESS( @@ -41,7 +42,7 @@ TEST_F(urDeviceGetSelectedTest, SuccessSubsetOfDevices) { } } -TEST_F(urDeviceGetSelectedTest, SuccessSelected_StarColonStar) { +TEST_P(urDeviceGetSelectedTest, SuccessSelected_StarColonStar) { setenv("ONEAPI_DEVICE_SELECTOR", "*:*", 1); uint32_t count = 0; ASSERT_SUCCESS( @@ -71,7 +72,7 @@ TEST_F(urDeviceGetSelectedTest, SuccessSelected_StarColonStar) { } } -TEST_F(urDeviceGetSelectedTest, SuccessSelected_StarColonZero) { +TEST_P(urDeviceGetSelectedTest, SuccessSelected_StarColonZero) { setenv("ONEAPI_DEVICE_SELECTOR", "*:0", 1); uint32_t count = 0; ASSERT_SUCCESS( @@ -85,7 +86,7 @@ TEST_F(urDeviceGetSelectedTest, SuccessSelected_StarColonZero) { } } -TEST_F(urDeviceGetSelectedTest, SuccessSelected_StarColonZeroCommaStar) { +TEST_P(urDeviceGetSelectedTest, SuccessSelected_StarColonZeroCommaStar) { setenv("ONEAPI_DEVICE_SELECTOR", "*:0,*", 1); uint32_t count = 0; ASSERT_SUCCESS( @@ -99,7 +100,7 @@ TEST_F(urDeviceGetSelectedTest, SuccessSelected_StarColonZeroCommaStar) { } } -TEST_F(urDeviceGetSelectedTest, SuccessSelected_DiscardStarColonStar) { +TEST_P(urDeviceGetSelectedTest, SuccessSelected_DiscardStarColonStar) { setenv("ONEAPI_DEVICE_SELECTOR", "!*:*", 1); uint32_t count = 0; ASSERT_SUCCESS( @@ -107,7 +108,7 @@ TEST_F(urDeviceGetSelectedTest, SuccessSelected_DiscardStarColonStar) { ASSERT_EQ(count, 0); } -TEST_F(urDeviceGetSelectedTest, SuccessSelected_SelectAndDiscard) { +TEST_P(urDeviceGetSelectedTest, SuccessSelected_SelectAndDiscard) { setenv("ONEAPI_DEVICE_SELECTOR", "*:0;!*:*", 1); uint32_t count = 0; ASSERT_SUCCESS( @@ -115,7 +116,7 @@ TEST_F(urDeviceGetSelectedTest, SuccessSelected_SelectAndDiscard) { ASSERT_EQ(count, 0); } -TEST_F(urDeviceGetSelectedTest, +TEST_P(urDeviceGetSelectedTest, SuccessSelected_SelectSomethingAndDiscardSomethingElse) { setenv("ONEAPI_DEVICE_SELECTOR", "*:0;!*:1", 1); uint32_t count = 0; @@ -130,7 +131,7 @@ TEST_F(urDeviceGetSelectedTest, } } -TEST_F(urDeviceGetSelectedTest, InvalidNullHandlePlatform) { +TEST_P(urDeviceGetSelectedTest, InvalidNullHandlePlatform) { unsetenv("ONEAPI_DEVICE_SELECTOR"); uint32_t count = 0; ASSERT_EQ_RESULT( @@ -138,7 +139,7 @@ TEST_F(urDeviceGetSelectedTest, InvalidNullHandlePlatform) { urDeviceGetSelected(nullptr, UR_DEVICE_TYPE_ALL, 0, nullptr, &count)); } -TEST_F(urDeviceGetSelectedTest, InvalidEnumerationDevicesType) { +TEST_P(urDeviceGetSelectedTest, InvalidEnumerationDevicesType) { unsetenv("ONEAPI_DEVICE_SELECTOR"); uint32_t count = 0; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_ENUMERATION, @@ -146,7 +147,7 @@ TEST_F(urDeviceGetSelectedTest, InvalidEnumerationDevicesType) { 0, nullptr, &count)); } -TEST_F(urDeviceGetSelectedTest, InvalidValueNumEntries) { +TEST_P(urDeviceGetSelectedTest, InvalidValueNumEntries) { unsetenv("ONEAPI_DEVICE_SELECTOR"); uint32_t count = 0; ASSERT_SUCCESS( @@ -158,7 +159,7 @@ TEST_F(urDeviceGetSelectedTest, InvalidValueNumEntries) { devices.data(), nullptr)); } -TEST_F(urDeviceGetSelectedTest, InvalidMissingBackend) { +TEST_P(urDeviceGetSelectedTest, InvalidMissingBackend) { setenv("ONEAPI_DEVICE_SELECTOR", ":garbage", 1); uint32_t count = 0; ASSERT_EQ_RESULT( @@ -167,7 +168,7 @@ TEST_F(urDeviceGetSelectedTest, InvalidMissingBackend) { ASSERT_EQ(count, 0); } -TEST_F(urDeviceGetSelectedTest, InvalidGarbageBackendString) { +TEST_P(urDeviceGetSelectedTest, InvalidGarbageBackendString) { setenv("ONEAPI_DEVICE_SELECTOR", "garbage:0", 1); uint32_t count = 0; ASSERT_EQ_RESULT( @@ -176,7 +177,7 @@ TEST_F(urDeviceGetSelectedTest, InvalidGarbageBackendString) { ASSERT_EQ(count, 0); } -TEST_F(urDeviceGetSelectedTest, InvalidMissingFilterStrings) { +TEST_P(urDeviceGetSelectedTest, InvalidMissingFilterStrings) { setenv("ONEAPI_DEVICE_SELECTOR", "*", 1); uint32_t count = 0; ASSERT_EQ_RESULT( @@ -191,7 +192,7 @@ TEST_F(urDeviceGetSelectedTest, InvalidMissingFilterStrings) { ASSERT_EQ(count2, 0); } -TEST_F(urDeviceGetSelectedTest, InvalidMissingFilterString) { +TEST_P(urDeviceGetSelectedTest, InvalidMissingFilterString) { setenv("ONEAPI_DEVICE_SELECTOR", "*:0,,2", 1); uint32_t count = 0; ASSERT_EQ_RESULT( @@ -200,7 +201,7 @@ TEST_F(urDeviceGetSelectedTest, InvalidMissingFilterString) { ASSERT_EQ(count, 0); } -TEST_F(urDeviceGetSelectedTest, InvalidTooManyDotsInFilterString) { +TEST_P(urDeviceGetSelectedTest, InvalidTooManyDotsInFilterString) { setenv("ONEAPI_DEVICE_SELECTOR", "*:0.1.2.3", 1); uint32_t count = 0; ASSERT_EQ_RESULT( @@ -209,7 +210,7 @@ TEST_F(urDeviceGetSelectedTest, InvalidTooManyDotsInFilterString) { ASSERT_EQ(count, 0); } -TEST_F(urDeviceGetSelectedTest, InvalidBadWildardInFilterString) { +TEST_P(urDeviceGetSelectedTest, InvalidBadWildardInFilterString) { setenv("ONEAPI_DEVICE_SELECTOR", "*:*.", 1); uint32_t count = 0; ASSERT_EQ_RESULT( @@ -224,7 +225,7 @@ TEST_F(urDeviceGetSelectedTest, InvalidBadWildardInFilterString) { ASSERT_EQ(count2, 0); } -TEST_F(urDeviceGetSelectedTest, InvalidSelectingNonexistentDevice) { +TEST_P(urDeviceGetSelectedTest, InvalidSelectingNonexistentDevice) { setenv("ONEAPI_DEVICE_SELECTOR", "*:4321", 1); uint32_t count = 0; ASSERT_SUCCESS( @@ -232,7 +233,7 @@ TEST_F(urDeviceGetSelectedTest, InvalidSelectingNonexistentDevice) { ASSERT_EQ(count, 0); } -TEST_F(urDeviceGetSelectedTest, InvalidSelectingNonexistentSubDevice) { +TEST_P(urDeviceGetSelectedTest, InvalidSelectingNonexistentSubDevice) { setenv("ONEAPI_DEVICE_SELECTOR", "*:0.4321", 1); uint32_t count = 0; ASSERT_SUCCESS( @@ -240,7 +241,7 @@ TEST_F(urDeviceGetSelectedTest, InvalidSelectingNonexistentSubDevice) { ASSERT_EQ(count, 0); } -TEST_F(urDeviceGetSelectedTest, InvalidSelectingNonexistentSubSubDevice) { +TEST_P(urDeviceGetSelectedTest, InvalidSelectingNonexistentSubSubDevice) { setenv("ONEAPI_DEVICE_SELECTOR", "*:0.0.4321", 1); uint32_t count = 0; ASSERT_SUCCESS( diff --git a/test/conformance/device/urDevicePartition.cpp b/test/conformance/device/urDevicePartition.cpp index cdba0d9d1c..4c62c899ac 100644 --- a/test/conformance/device/urDevicePartition.cpp +++ b/test/conformance/device/urDevicePartition.cpp @@ -5,11 +5,8 @@ #include #include -using urDevicePartitionTest = uur::urAllDevicesTest; - -template -struct urDevicePartitionTestWithParam : uur::urAllDevicesTest, - ::testing::WithParamInterface {}; +using urDevicePartitionTest = uur::urDeviceTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDevicePartitionTest); void getNumberComputeUnits(ur_device_handle_t device, uint32_t &n_compute_units) { @@ -17,174 +14,149 @@ void getNumberComputeUnits(ur_device_handle_t device, ASSERT_NE(n_compute_units, 0); } -TEST_F(urDevicePartitionTest, PartitionEquallySuccess) { - for (auto device : devices) { +TEST_P(urDevicePartitionTest, PartitionEquallySuccess) { - if (!uur::hasDevicePartitionSupport(device, - UR_DEVICE_PARTITION_EQUALLY)) { - ::testing::Message() << "Device: \'" << device - << "\' does not support partitioning equally."; - continue; - } + if (!uur::hasDevicePartitionSupport(device, UR_DEVICE_PARTITION_EQUALLY)) { + ::testing::Message() << "Device: \'" << device + << "\' does not support partitioning equally."; + GTEST_SKIP(); + } - uint32_t n_compute_units = 0; - ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_compute_units)); - - for (uint32_t i = 1; i < n_compute_units; ++i) { - ur_device_partition_property_t property = - uur::makePartitionEquallyDesc(i); - - ur_device_partition_properties_t properties{ - UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, - nullptr, - &property, - 1, - }; - - // Get the number of devices that will be created - uint32_t n_devices = 0; - ASSERT_SUCCESS( - urDevicePartition(device, &properties, 0, nullptr, &n_devices)); - ASSERT_NE(n_devices, 0); - - std::vector sub_devices(n_devices); - ASSERT_SUCCESS(urDevicePartition( - device, &properties, static_cast(sub_devices.size()), - sub_devices.data(), nullptr)); - for (auto sub_device : sub_devices) { - ASSERT_NE(sub_device, nullptr); - ASSERT_SUCCESS(urDeviceRelease(sub_device)); - } + uint32_t n_compute_units = 0; + ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_compute_units)); + + for (uint32_t i = 1; i < n_compute_units; ++i) { + ur_device_partition_property_t property = + uur::makePartitionEquallyDesc(i); + + ur_device_partition_properties_t properties{ + UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, + nullptr, + &property, + 1, + }; + + // Get the number of devices that will be created + uint32_t n_devices = 0; + ASSERT_SUCCESS( + urDevicePartition(device, &properties, 0, nullptr, &n_devices)); + ASSERT_NE(n_devices, 0); + + std::vector sub_devices(n_devices); + ASSERT_SUCCESS(urDevicePartition( + device, &properties, static_cast(sub_devices.size()), + sub_devices.data(), nullptr)); + for (auto sub_device : sub_devices) { + ASSERT_NE(sub_device, nullptr); + ASSERT_SUCCESS(urDeviceRelease(sub_device)); } } } -TEST_F(urDevicePartitionTest, PartitionByCounts) { +TEST_P(urDevicePartitionTest, PartitionByCounts) { - for (auto device : devices) { + if (!uur::hasDevicePartitionSupport(device, + UR_DEVICE_PARTITION_BY_COUNTS)) { + ::testing::Message() << "Device: \'" << device + << "\' does not support partitioning by counts.\n"; + GTEST_SKIP(); + } - if (!uur::hasDevicePartitionSupport(device, - UR_DEVICE_PARTITION_BY_COUNTS)) { - ::testing::Message() - << "Device: \'" << device - << "\' does not support partitioning by counts.\n"; - continue; - } + uint32_t n_cu_in_device = 0; + ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_cu_in_device)); + + enum class Combination { ONE, HALF, ALL_MINUS_ONE, ALL }; + + std::vector combinations{Combination::ONE, Combination::ALL}; - uint32_t n_cu_in_device = 0; - ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_cu_in_device)); + if (n_cu_in_device >= 2) { + combinations.push_back(Combination::HALF); + combinations.push_back(Combination::ALL_MINUS_ONE); + } - enum class Combination { ONE, HALF, ALL_MINUS_ONE, ALL }; + uint32_t n_cu_across_sub_devices; + for (const auto Combination : combinations) { - std::vector combinations{Combination::ONE, - Combination::ALL}; + std::vector property_list; - if (n_cu_in_device >= 2) { - combinations.push_back(Combination::HALF); - combinations.push_back(Combination::ALL_MINUS_ONE); + switch (Combination) { + case Combination::ONE: { + n_cu_across_sub_devices = 1; + property_list.push_back(uur::makePartitionByCountsDesc(1)); + break; + } + case Combination::HALF: { + n_cu_across_sub_devices = (n_cu_in_device / 2) * 2; + property_list.push_back( + uur::makePartitionByCountsDesc(n_cu_in_device / 2)); + property_list.push_back( + uur::makePartitionByCountsDesc(n_cu_in_device / 2)); + break; + } + case Combination::ALL_MINUS_ONE: { + n_cu_across_sub_devices = n_cu_in_device - 1; + property_list.push_back( + uur::makePartitionByCountsDesc(n_cu_in_device - 1)); + break; + } + case Combination::ALL: { + n_cu_across_sub_devices = n_cu_in_device; + property_list.push_back( + uur::makePartitionByCountsDesc(n_cu_in_device)); + break; + } } - uint32_t n_cu_across_sub_devices; - for (const auto Combination : combinations) { - - std::vector property_list; - - switch (Combination) { - case Combination::ONE: { - n_cu_across_sub_devices = 1; - property_list.push_back(uur::makePartitionByCountsDesc(1)); - break; - } - case Combination::HALF: { - n_cu_across_sub_devices = (n_cu_in_device / 2) * 2; - property_list.push_back( - uur::makePartitionByCountsDesc(n_cu_in_device / 2)); - property_list.push_back( - uur::makePartitionByCountsDesc(n_cu_in_device / 2)); - break; - } - case Combination::ALL_MINUS_ONE: { - n_cu_across_sub_devices = n_cu_in_device - 1; - property_list.push_back( - uur::makePartitionByCountsDesc(n_cu_in_device - 1)); - break; - } - case Combination::ALL: { - n_cu_across_sub_devices = n_cu_in_device; - property_list.push_back( - uur::makePartitionByCountsDesc(n_cu_in_device)); - break; - } - } - - ur_device_partition_properties_t properties{ - UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, - nullptr, - property_list.data(), - property_list.size(), - }; - - // Get the number of devices that will be created - uint32_t n_devices = 0; - ASSERT_SUCCESS( - urDevicePartition(device, &properties, 0, nullptr, &n_devices)); - ASSERT_EQ(n_devices, property_list.size()); - - std::vector sub_devices(n_devices); - ASSERT_SUCCESS(urDevicePartition( - device, &properties, static_cast(sub_devices.size()), - sub_devices.data(), nullptr)); - - uint32_t sum = 0; - for (auto sub_device : sub_devices) { - ASSERT_NE(sub_device, nullptr); - uint32_t n_cu_in_sub_device; - ASSERT_NO_FATAL_FAILURE( - getNumberComputeUnits(sub_device, n_cu_in_sub_device)); - sum += n_cu_in_sub_device; - ASSERT_SUCCESS(urDeviceRelease(sub_device)); - } - ASSERT_EQ(n_cu_across_sub_devices, sum); + ur_device_partition_properties_t properties{ + UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, + nullptr, + property_list.data(), + property_list.size(), + }; + + // Get the number of devices that will be created + uint32_t n_devices = 0; + ASSERT_SUCCESS( + urDevicePartition(device, &properties, 0, nullptr, &n_devices)); + ASSERT_EQ(n_devices, property_list.size()); + + std::vector sub_devices(n_devices); + ASSERT_SUCCESS(urDevicePartition( + device, &properties, static_cast(sub_devices.size()), + sub_devices.data(), nullptr)); + + uint32_t sum = 0; + for (auto sub_device : sub_devices) { + ASSERT_NE(sub_device, nullptr); + uint32_t n_cu_in_sub_device; + ASSERT_NO_FATAL_FAILURE( + getNumberComputeUnits(sub_device, n_cu_in_sub_device)); + sum += n_cu_in_sub_device; + ASSERT_SUCCESS(urDeviceRelease(sub_device)); } + ASSERT_EQ(n_cu_across_sub_devices, sum); } } -using urDevicePartitionAffinityDomainTest = - urDevicePartitionTestWithParam; -TEST_P(urDevicePartitionAffinityDomainTest, PartitionByAffinityDomain) { - - for (auto device : devices) { +TEST_P(urDevicePartitionTest, PartitionParentSuccess) { - if (!uur::hasDevicePartitionSupport( - device, UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN)) { - ::testing::Message() << "Device \'" << device - << "\' does not support partitioning by " - "affinity domain.\n"; - continue; - } + if (!uur::hasDevicePartitionSupport(device, UR_DEVICE_PARTITION_EQUALLY)) { + ::testing::Message() << "Device: \'" << device + << "\' does not support partitioning equally."; + GTEST_SKIP(); + } - uint32_t n_compute_units = 0; - ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_compute_units)); - - // Skip if the affinity domain is not supported by device - ur_device_affinity_domain_flags_t flag = GetParam(); - ur_device_affinity_domain_flags_t supported_flags{0}; - ASSERT_SUCCESS(uur::GetDevicePartitionAffinityDomainFlags( - device, supported_flags)); - if (!(flag & supported_flags)) { - ::testing::Message() - << static_cast(flag) - << " is not supported by the device: \'" << device << "\'.\n"; - continue; - } + uint32_t n_compute_units = 0; + ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_compute_units)); - ur_device_partition_property_t prop = - uur::makePartitionByAffinityDomain(flag); + for (uint32_t i = 1; i < n_compute_units; ++i) { + ur_device_partition_property_t property = + uur::makePartitionEquallyDesc(i); ur_device_partition_properties_t properties{ UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, nullptr, - &prop, + &property, 1, }; @@ -198,30 +170,22 @@ TEST_P(urDevicePartitionAffinityDomainTest, PartitionByAffinityDomain) { ASSERT_SUCCESS(urDevicePartition( device, &properties, static_cast(sub_devices.size()), sub_devices.data(), nullptr)); - for (auto sub_device : sub_devices) { + size_t size = 0; + urDeviceGetInfo(sub_device, UR_DEVICE_INFO_PARENT_DEVICE, 0, + nullptr, &size); + ur_device_handle_t parent_device = nullptr; + urDeviceGetInfo(sub_device, UR_DEVICE_INFO_PARENT_DEVICE, size, + &parent_device, nullptr); + ASSERT_EQ(parent_device, device); + ASSERT_NE(sub_device, nullptr); ASSERT_SUCCESS(urDeviceRelease(sub_device)); } } } -INSTANTIATE_TEST_SUITE_P( - , urDevicePartitionAffinityDomainTest, - ::testing::Values(UR_DEVICE_AFFINITY_DOMAIN_FLAG_NUMA, - UR_DEVICE_AFFINITY_DOMAIN_FLAG_L4_CACHE, - UR_DEVICE_AFFINITY_DOMAIN_FLAG_L3_CACHE, - UR_DEVICE_AFFINITY_DOMAIN_FLAG_L2_CACHE, - UR_DEVICE_AFFINITY_DOMAIN_FLAG_L1_CACHE, - UR_DEVICE_AFFINITY_DOMAIN_FLAG_NEXT_PARTITIONABLE), - [](const ::testing::TestParamInfo - &info) { - std::stringstream ss; - ss << static_cast(info.param); - return ss.str(); - }); - -TEST_F(urDevicePartitionTest, InvalidNullHandleDevice) { +TEST_P(urDevicePartitionTest, InvalidNullHandleDevice) { ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1); ur_device_partition_properties_t properties{ UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, @@ -235,84 +199,164 @@ TEST_F(urDevicePartitionTest, InvalidNullHandleDevice) { urDevicePartition(nullptr, &properties, 1, &sub_device, nullptr)); } -TEST_F(urDevicePartitionTest, InvalidNullPointerProperties) { - for (auto device : devices) { - ur_device_handle_t sub_device = nullptr; - ASSERT_EQ_RESULT( - UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDevicePartition(device, nullptr, 1, &sub_device, nullptr)); - } +TEST_P(urDevicePartitionTest, InvalidNullPointerProperties) { + ur_device_handle_t sub_device = nullptr; + ASSERT_EQ_RESULT( + UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDevicePartition(device, nullptr, 1, &sub_device, nullptr)); } -TEST_F(urDevicePartitionTest, InvalidNullPointerPropertiesArray) { +TEST_P(urDevicePartitionTest, InvalidNullPointerPropertiesArray) { ur_device_partition_properties_t properties{ UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, nullptr, nullptr, 0, }; - for (auto device : devices) { - ur_device_handle_t sub_device = nullptr; - ASSERT_EQ_RESULT( - UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDevicePartition(device, &properties, 1, &sub_device, nullptr)); - } + ur_device_handle_t sub_device = nullptr; + ASSERT_EQ_RESULT( + UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDevicePartition(device, &properties, 1, &sub_device, nullptr)); } -TEST_F(urDevicePartitionTest, SuccessSubSet) { - for (auto device : devices) { +TEST_P(urDevicePartitionTest, SuccessSubSet) { - if (!uur::hasDevicePartitionSupport(device, - UR_DEVICE_PARTITION_EQUALLY)) { - ::testing::Message() << "Device: \'" << device - << "\' does not support partitioning equally."; - continue; - } + if (!uur::hasDevicePartitionSupport(device, UR_DEVICE_PARTITION_EQUALLY)) { + ::testing::Message() << "Device: \'" << device + << "\' does not support partitioning equally."; + GTEST_SKIP(); + } - uint32_t n_compute_units = 0; - ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_compute_units)); + uint32_t n_compute_units = 0; + ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_compute_units)); - // partition for 1 compute unit per sub-device - ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1); - ur_device_partition_properties_t properties{ - UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, - nullptr, - &prop, - 1, - }; + // partition for 1 compute unit per sub-device + ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1); + ur_device_partition_properties_t properties{ + UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, + nullptr, + &prop, + 1, + }; - // Get the number of devices that will be created - uint32_t n_devices = 0; - ASSERT_SUCCESS( - urDevicePartition(device, &properties, 0, nullptr, &n_devices)); - ASSERT_NE(n_devices, 0); + // Get the number of devices that will be created + uint32_t n_devices = 0; + ASSERT_SUCCESS( + urDevicePartition(device, &properties, 0, nullptr, &n_devices)); + ASSERT_NE(n_devices, 0); - // We can request only a subset of these devices from [0, n_devices] - for (size_t subset = 0; subset <= n_devices; ++subset) { - std::vector sub_devices(subset); - ASSERT_SUCCESS(urDevicePartition( - device, &properties, static_cast(sub_devices.size()), - sub_devices.data(), nullptr)); - for (auto sub_device : sub_devices) { - ASSERT_NE(sub_device, nullptr); - ASSERT_SUCCESS(urDeviceRelease(sub_device)); - } + // We can request only a subset of these devices from [0, n_devices] + for (size_t subset = 0; subset <= n_devices; ++subset) { + std::vector sub_devices(subset); + ASSERT_SUCCESS(urDevicePartition( + device, &properties, static_cast(sub_devices.size()), + sub_devices.data(), nullptr)); + for (auto sub_device : sub_devices) { + ASSERT_NE(sub_device, nullptr); + ASSERT_SUCCESS(urDeviceRelease(sub_device)); } } } +using urDevicePartitionAffinityDomainTest = + uur::urDeviceTestWithParam; + +UUR_DEVICE_TEST_SUITE_P( + urDevicePartitionAffinityDomainTest, + ::testing::Values(UR_DEVICE_AFFINITY_DOMAIN_FLAG_NUMA, + UR_DEVICE_AFFINITY_DOMAIN_FLAG_L4_CACHE, + UR_DEVICE_AFFINITY_DOMAIN_FLAG_L3_CACHE, + UR_DEVICE_AFFINITY_DOMAIN_FLAG_L2_CACHE, + UR_DEVICE_AFFINITY_DOMAIN_FLAG_L1_CACHE, + UR_DEVICE_AFFINITY_DOMAIN_FLAG_NEXT_PARTITIONABLE), + uur::deviceTestWithParamPrinter); + +TEST_P(urDevicePartitionAffinityDomainTest, PartitionByAffinityDomain) { + + if (!uur::hasDevicePartitionSupport( + device, UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN)) { + ::testing::Message() << "Device \'" << device + << "\' does not support partitioning by " + "affinity domain.\n"; + GTEST_SKIP(); + } + + uint32_t n_compute_units = 0; + ASSERT_NO_FATAL_FAILURE(getNumberComputeUnits(device, n_compute_units)); + + // Skip if the affinity domain is not supported by device + ur_device_affinity_domain_flags_t flag = getParam(); + ur_device_affinity_domain_flags_t supported_flags{0}; + ASSERT_SUCCESS( + uur::GetDevicePartitionAffinityDomainFlags(device, supported_flags)); + if (!(flag & supported_flags)) { + ::testing::Message() + << static_cast(flag) + << " is not supported by the device: \'" << device << "\'.\n"; + GTEST_SKIP(); + } + + ur_device_partition_property_t prop = + uur::makePartitionByAffinityDomain(flag); + + ur_device_partition_properties_t properties{ + UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, + nullptr, + &prop, + 1, + }; + + // Get the number of devices that will be created + uint32_t n_devices = 0; + ASSERT_SUCCESS( + urDevicePartition(device, &properties, 0, nullptr, &n_devices)); + ASSERT_NE(n_devices, 0); + + std::vector sub_devices(n_devices); + ASSERT_SUCCESS(urDevicePartition(device, &properties, + static_cast(sub_devices.size()), + sub_devices.data(), nullptr)); + + for (auto sub_device : sub_devices) { + ASSERT_NE(sub_device, nullptr); + ASSERT_SUCCESS(urDeviceRelease(sub_device)); + } +} + using urDevicePartitionByCountsTestWithParam = - urDevicePartitionTestWithParam>; -TEST_P(urDevicePartitionByCountsTestWithParam, CountsOrdering) { - ur_device_handle_t device = devices[0]; + uur::urDeviceTestWithParam>; + +std::string +CountPrinter(const ::testing::TestParamInfo< + std::tuple>> &info) { + auto device = std::get<0>(info.param).device; + auto param = std::get<1>(info.param); + std::stringstream ss; + for (size_t i = 0; i < param.size(); ++i) { + if (i > 0) { + ss << "_"; + } + ss << param[i]; + } + return uur::GetPlatformAndDeviceName(device) + "__" + ss.str(); +} +UUR_DEVICE_TEST_SUITE_P(urDevicePartitionByCountsTestWithParam, + ::testing::Values(std::vector{2, 4}, + std::vector{1, 4}, + std::vector{2, 3}, + std::vector{3, 2}, + std::vector{3, 1}), + CountPrinter); + +TEST_P(urDevicePartitionByCountsTestWithParam, CountsOrdering) { if (!uur::hasDevicePartitionSupport(device, UR_DEVICE_PARTITION_BY_COUNTS)) { GTEST_SKIP() << "Device \'" << device << "\' does not support partitioning by counts\n"; } - auto requested_counts = GetParam(); + auto requested_counts = getParam(); std::vector property_list; for (size_t i = 0; i < requested_counts.size(); ++i) { @@ -341,19 +385,3 @@ TEST_P(urDevicePartitionByCountsTestWithParam, CountsOrdering) { ASSERT_EQ(requested_counts, actual_counts); } - -INSTANTIATE_TEST_SUITE_P( - , urDevicePartitionByCountsTestWithParam, - ::testing::Values(std::vector{2, 4}, std::vector{1, 4}, - std::vector{2, 3}, std::vector{3, 2}, - std::vector{3, 1}), - [](const ::testing::TestParamInfo> &info) { - std::stringstream ss; - for (size_t i = 0; i < info.param.size(); ++i) { - if (i > 0) { - ss << "_"; - } - ss << info.param[i]; - } - return ss.str(); - }); diff --git a/test/conformance/device/urDeviceRelease.cpp b/test/conformance/device/urDeviceRelease.cpp index dd5510394f..0f71ebd475 100644 --- a/test/conformance/device/urDeviceRelease.cpp +++ b/test/conformance/device/urDeviceRelease.cpp @@ -4,65 +4,59 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -struct urDeviceReleaseTest : uur::urAllDevicesTest {}; +struct urDeviceReleaseTest : uur::urDeviceTest {}; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceReleaseTest); -TEST_F(urDeviceReleaseTest, Success) { - for (auto device : devices) { - ASSERT_SUCCESS(urDeviceRetain(device)); +TEST_P(urDeviceReleaseTest, Success) { + uint32_t prevRefCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, prevRefCount)); - uint32_t prevRefCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, prevRefCount)); + EXPECT_SUCCESS(urDeviceRelease(device)); - EXPECT_SUCCESS(urDeviceRelease(device)); + uint32_t refCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, refCount)); - uint32_t refCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, refCount)); - - /* If device is a root level device, the device reference counts should + /* If device is a root level device, the device reference counts should * remain unchanged */ - ASSERT_EQ(prevRefCount, refCount); - } + ASSERT_EQ(prevRefCount, refCount); } -TEST_F(urDeviceReleaseTest, SuccessSubdevices) { - for (auto device : devices) { - if (!uur::hasDevicePartitionSupport(device, - UR_DEVICE_PARTITION_EQUALLY)) { - ::testing::Message() << "Device: \'" << device - << "\' does not support partitioning equally."; - continue; - } +TEST_P(urDeviceReleaseTest, SuccessSubdevices) { + if (!uur::hasDevicePartitionSupport(device, UR_DEVICE_PARTITION_EQUALLY)) { + ::testing::Message() << "Device: \'" << device + << "\' does not support partitioning equally."; + GTEST_SKIP(); + } - ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1); + ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1); - ur_device_partition_properties_t properties{ - UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, - nullptr, - &prop, - 1, - }; + ur_device_partition_properties_t properties{ + UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, + nullptr, + &prop, + 1, + }; - ur_device_handle_t sub_device = nullptr; - ASSERT_SUCCESS( - urDevicePartition(device, &properties, 1, &sub_device, nullptr)); + ur_device_handle_t sub_device = nullptr; + ASSERT_SUCCESS( + urDevicePartition(device, &properties, 1, &sub_device, nullptr)); - ASSERT_SUCCESS(urDeviceRetain(sub_device)); + ASSERT_SUCCESS(urDeviceRetain(sub_device)); - uint32_t prevRefCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, prevRefCount)); + uint32_t prevRefCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, prevRefCount)); - EXPECT_SUCCESS(urDeviceRelease(sub_device)); + EXPECT_SUCCESS(urDeviceRelease(sub_device)); - uint32_t refCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, refCount)); + uint32_t refCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, refCount)); - ASSERT_GT(prevRefCount, refCount); + ASSERT_GT(prevRefCount, refCount); - EXPECT_SUCCESS(urDeviceRelease(sub_device)); - } + EXPECT_SUCCESS(urDeviceRelease(sub_device)); } -TEST_F(urDeviceReleaseTest, InvalidNullHandle) { +TEST_P(urDeviceReleaseTest, InvalidNullHandle) { ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, urDeviceRelease(nullptr)); } diff --git a/test/conformance/device/urDeviceRetain.cpp b/test/conformance/device/urDeviceRetain.cpp index 6651bd26b3..9de9fdde4f 100644 --- a/test/conformance/device/urDeviceRetain.cpp +++ b/test/conformance/device/urDeviceRetain.cpp @@ -5,61 +5,57 @@ #include -using urDeviceRetainTest = uur::urAllDevicesTest; +using urDeviceRetainTest = uur::urDeviceTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceRetainTest); -TEST_F(urDeviceRetainTest, Success) { - for (auto device : devices) { - uint32_t prevRefCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, prevRefCount)); +TEST_P(urDeviceRetainTest, Success) { + uint32_t prevRefCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, prevRefCount)); - ASSERT_SUCCESS(urDeviceRetain(device)); + ASSERT_SUCCESS(urDeviceRetain(device)); - uint32_t refCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, refCount)); + uint32_t refCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(device, refCount)); - /* If device is a root level device, the device reference counts should + /* If device is a root level device, the device reference counts should * remain unchanged */ - ASSERT_EQ(prevRefCount, refCount); - } + ASSERT_EQ(prevRefCount, refCount); } -TEST_F(urDeviceRetainTest, SuccessSubdevices) { - for (auto device : devices) { - if (!uur::hasDevicePartitionSupport(device, - UR_DEVICE_PARTITION_EQUALLY)) { - ::testing::Message() << "Device: \'" << device - << "\' does not support partitioning equally."; - continue; - } +TEST_P(urDeviceRetainTest, SuccessSubdevices) { + if (!uur::hasDevicePartitionSupport(device, UR_DEVICE_PARTITION_EQUALLY)) { + ::testing::Message() << "Device: \'" << device + << "\' does not support partitioning equally."; + GTEST_SKIP(); + } - ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1); - ur_device_partition_properties_t properties{ - UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, - nullptr, - &prop, - 1, - }; + ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1); + ur_device_partition_properties_t properties{ + UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES, + nullptr, + &prop, + 1, + }; - ur_device_handle_t sub_device = nullptr; - ASSERT_SUCCESS( - urDevicePartition(device, &properties, 1, &sub_device, nullptr)); + ur_device_handle_t sub_device = nullptr; + ASSERT_SUCCESS( + urDevicePartition(device, &properties, 1, &sub_device, nullptr)); - uint32_t prevRefCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, prevRefCount)); + uint32_t prevRefCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, prevRefCount)); - ASSERT_SUCCESS(urDeviceRetain(sub_device)); + ASSERT_SUCCESS(urDeviceRetain(sub_device)); - uint32_t refCount = 0; - ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, refCount)); + uint32_t refCount = 0; + ASSERT_SUCCESS(uur::GetObjectReferenceCount(sub_device, refCount)); - ASSERT_LT(prevRefCount, refCount); + ASSERT_LT(prevRefCount, refCount); - EXPECT_SUCCESS(urDeviceRelease(sub_device)); - EXPECT_SUCCESS(urDeviceRelease(sub_device)); - } + EXPECT_SUCCESS(urDeviceRelease(sub_device)); + EXPECT_SUCCESS(urDeviceRelease(sub_device)); } -TEST_F(urDeviceRetainTest, InvalidNullHandle) { +TEST_P(urDeviceRetainTest, InvalidNullHandle) { ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, urDeviceRetain(nullptr)); } diff --git a/test/conformance/device/urDeviceSelectBinary.cpp b/test/conformance/device/urDeviceSelectBinary.cpp index 44d32e3c6d..7776a15357 100644 --- a/test/conformance/device/urDeviceSelectBinary.cpp +++ b/test/conformance/device/urDeviceSelectBinary.cpp @@ -3,7 +3,10 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -using urDeviceSelectBinaryTest = uur::urAllDevicesTest; +#include + +using urDeviceSelectBinaryTest = uur::urDeviceTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceSelectBinaryTest); static constexpr ur_device_binary_t binaries[] = { {UR_STRUCTURE_TYPE_DEVICE_BINARY, nullptr, UR_DEVICE_BINARY_TARGET_UNKNOWN}, @@ -20,43 +23,37 @@ static constexpr ur_device_binary_t binaries[] = { static constexpr uint32_t binaries_length = sizeof(binaries) / sizeof(ur_device_binary_t); -TEST_F(urDeviceSelectBinaryTest, Success) { - for (auto device : devices) { - uint32_t selected_binary = binaries_length; // invalid index - ASSERT_SUCCESS(urDeviceSelectBinary(device, binaries, binaries_length, - &selected_binary)); - ASSERT_LT(selected_binary, binaries_length); - } +TEST_P(urDeviceSelectBinaryTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + uint32_t selected_binary = binaries_length; // invalid index + ASSERT_SUCCESS(urDeviceSelectBinary(device, binaries, binaries_length, + &selected_binary)); + ASSERT_LT(selected_binary, binaries_length); } -TEST_F(urDeviceSelectBinaryTest, InvalidNullHandleDevice) { +TEST_P(urDeviceSelectBinaryTest, InvalidNullHandleDevice) { ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_NULL_HANDLE, urDeviceSelectBinary(nullptr, binaries, binaries_length, nullptr)); } -TEST_F(urDeviceSelectBinaryTest, InvalidNullPointerBinaries) { - for (auto device : devices) { - uint32_t selected_binary; - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDeviceSelectBinary(device, nullptr, binaries_length, - &selected_binary)); - } +TEST_P(urDeviceSelectBinaryTest, InvalidNullPointerBinaries) { + uint32_t selected_binary; + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDeviceSelectBinary(device, nullptr, binaries_length, + &selected_binary)); } -TEST_F(urDeviceSelectBinaryTest, InvalidNullPointerSelectedBinary) { - for (auto device : devices) { - ASSERT_EQ_RESULT( - UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDeviceSelectBinary(device, binaries, binaries_length, nullptr)); - } +TEST_P(urDeviceSelectBinaryTest, InvalidNullPointerSelectedBinary) { + ASSERT_EQ_RESULT( + UR_RESULT_ERROR_INVALID_NULL_POINTER, + urDeviceSelectBinary(device, binaries, binaries_length, nullptr)); } -TEST_F(urDeviceSelectBinaryTest, InvalidValueNumBinaries) { - for (auto device : devices) { - uint32_t selected_binary; - ASSERT_EQ_RESULT( - UR_RESULT_ERROR_INVALID_SIZE, - urDeviceSelectBinary(device, binaries, 0, &selected_binary)); - } +TEST_P(urDeviceSelectBinaryTest, InvalidValueNumBinaries) { + uint32_t selected_binary; + ASSERT_EQ_RESULT( + UR_RESULT_ERROR_INVALID_SIZE, + urDeviceSelectBinary(device, binaries, 0, &selected_binary)); } diff --git a/test/conformance/enqueue/enqueue_adapter_cuda.match b/test/conformance/enqueue/enqueue_adapter_cuda.match deleted file mode 100644 index 8aa9600f5e..0000000000 --- a/test/conformance/enqueue/enqueue_adapter_cuda.match +++ /dev/null @@ -1,10 +0,0 @@ -urEnqueueKernelLaunchTest.InvalidKernelArgs/* -urEnqueueKernelLaunchKernelWgSizeTest.NonMatchingLocalSize/* -urEnqueueKernelLaunchKernelSubGroupTest.Success/* -urEnqueueMemBufferMapTestWithWriteFlagParam.SuccessWrite/*__UR_MAP_FLAG_WRITE_INVALIDATE_REGION -urEnqueueUSMAdviseWithParamTest.Success/*__UR_USM_ADVICE_FLAG_DEFAULT -urEnqueueUSMAdviseTest.MultipleParamsSuccess/* -urEnqueueUSMPrefetchWithParamTest.Success/*__UR_USM_MIGRATION_FLAG_DEFAULT -urEnqueueUSMPrefetchWithParamTest.CheckWaitEvent/*__UR_USM_MIGRATION_FLAG_DEFAULT -urEnqueueTimestampRecordingExpTest.Success/* -urEnqueueTimestampRecordingExpTest.SuccessBlocking/* diff --git a/test/conformance/enqueue/enqueue_adapter_hip.match b/test/conformance/enqueue/enqueue_adapter_hip.match deleted file mode 100644 index c59d228ca8..0000000000 --- a/test/conformance/enqueue/enqueue_adapter_hip.match +++ /dev/null @@ -1,21 +0,0 @@ -# HIP can't check kernel arguments -urEnqueueKernelLaunchTest.InvalidKernelArgs/* -urEnqueueKernelLaunchKernelWgSizeTest.NonMatchingLocalSize/* -urEnqueueKernelLaunchKernelSubGroupTest.Success/* -urEnqueueKernelLaunchUSMLinkedList.Success/*__UsePoolEnabled -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_row_2D -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_3d_2d -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_row_2D -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_3d_2d - -# HIP doesn't ignore unsupported USM advice or prefetching. Instead of -# returning UR_RESULT_SUCCESS as per the spec, it instead returns -# UR_RESULT_ERROR_ADAPTER_SPECIFIC to issue a warning. These tests will fail -# until this is rectified. -urEnqueueUSMAdviseWithParamTest.Success/*__UR_USM_ADVICE_FLAG_DEFAULT -urEnqueueUSMAdviseTest.MultipleParamsSuccess/* -urEnqueueUSMPrefetchWithParamTest.Success/*__UR_USM_MIGRATION_FLAG_DEFAULT -urEnqueueUSMPrefetchWithParamTest.CheckWaitEvent/*__UR_USM_MIGRATION_FLAG_DEFAULT - -urEnqueueTimestampRecordingExpTest.Success/* -urEnqueueTimestampRecordingExpTest.SuccessBlocking/* diff --git a/test/conformance/enqueue/enqueue_adapter_level_zero.match b/test/conformance/enqueue/enqueue_adapter_level_zero.match deleted file mode 100644 index 286cafc7fa..0000000000 --- a/test/conformance/enqueue/enqueue_adapter_level_zero.match +++ /dev/null @@ -1,60 +0,0 @@ -{{OPT}}urEnqueueEventsWaitTest.Success/* -{{OPT}}urEnqueueKernelLaunchTest.InvalidKernelArgs/* -{{OPT}}urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/UseEventsNoQueuePerThread -{{OPT}}urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/NoUseEventsNoQueuePerThread -{{OPT}}urEnqueueKernelLaunchKernelWgSizeTest.Success/* -{{OPT}}urEnqueueKernelLaunchKernelSubGroupTest.Success/* -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_2d_3d -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_3d_2d -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_non_zero_offsets_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_different_buffer_sizes_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_column_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_3d_with_offsets -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_2d_3d -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_3d_2d -{{OPT}}urEnqueueMemBufferMapMultiDeviceTest.* -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_3d_with_offsets -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_2d_3d -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_3d_2d -{{OPT}}urEnqueueMemImageCopyTest.InvalidSize/* -{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin1D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin2D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin3D/* -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest* -{{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/* -urEnqueueUSMAdviseTest.InvalidSizeTooLarge/* -{{OPT}}urEnqueueUSMMemcpyTest.Blocking/* -{{OPT}}urEnqueueUSMMemcpyTest.BlockingWithEvent/* -{{OPT}}urEnqueueUSMMemcpyTest.WaitForDependencies/* -urEnqueueUSMPrefetchTest.InvalidSizeTooLarge/* diff --git a/test/conformance/enqueue/enqueue_adapter_level_zero_v2.match b/test/conformance/enqueue/enqueue_adapter_level_zero_v2.match deleted file mode 100644 index 58a6ec4116..0000000000 --- a/test/conformance/enqueue/enqueue_adapter_level_zero_v2.match +++ /dev/null @@ -1,73 +0,0 @@ -urEnqueueKernelLaunchTest.InvalidKernelArgs/* -urEnqueueKernelLaunchKernelWgSizeTest.Success/* -{{OPT}}urEnqueueKernelLaunchIncrementTest.Success/*__UseEventsEnabled -{{OPT}}urEnqueueKernelLaunchIncrementTest.Success/*__UseEventsDisabled -{{OPT}}urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/UseEventsNoQueuePerThread -{{OPT}}urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/NoUseEventsNoQueuePerThread -{{OPT}}urEnqueueKernelLaunchKernelSubGroupTest.Success/* -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_whole_buffer_2D -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_non_zero_offsets_2D -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_different_buffer_sizes_2D -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_column_2D -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_row_2D -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_3d -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_3d_with_offsets -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_2d_3d -{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/*__copy_3d_2d -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_whole_buffer_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_non_zero_offsets_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_different_buffer_sizes_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_column_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_row_2D -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_3d -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_3d_with_offsets -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_2d_3d -{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/*__write_3d_2d -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_whole_buffer_2D -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_non_zero_offsets_2D -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_different_buffer_sizes_2D -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_column_2D -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_row_2D -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_3d -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_3d_with_offsets -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_2d_3d -{{OPT}}urEnqueueMemBufferWriteRectTestWithParam.Success/*__write_3d_2d -{{OPT}}urEnqueueMemImageCopyTest.Success/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopy/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithSrcOffset/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithDstOffset/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleImageSrc/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleImageDst/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidSize/* -{{OPT}}urEnqueueMemImageReadTest.Success1D/* -{{OPT}}urEnqueueMemImageReadTest.Success2D/* -{{OPT}}urEnqueueMemImageReadTest.Success3D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueMemImageReadTest.InvalidNullHandleImage/* -{{OPT}}urEnqueueMemImageReadTest.InvalidNullPointerDst/* -{{OPT}}urEnqueueMemImageReadTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin1D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin2D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidOrigin3D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidRegion1D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidRegion2D/* -{{OPT}}urEnqueueMemImageReadTest.InvalidRegion3D/* -{{OPT}}urEnqueueMemImageWriteTest.Success1D/* -{{OPT}}urEnqueueMemImageWriteTest.Success2D/* -{{OPT}}urEnqueueMemImageWriteTest.Success3D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidNullHandleImage/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidNullPointerSrc/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin1D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin2D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidOrigin3D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion1D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion2D/* -{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion3D/* -{{OPT}}urEnqueueKernelLaunchMultiDeviceTest.KernelLaunchReadDifferentQueues/* -urEnqueueUSMAdviseTest.InvalidSizeTooLarge/* -urEnqueueUSMPrefetchTest.InvalidSizeTooLarge/* -{{OPT}}urEnqueueTimestampRecordingExpTest.SuccessBlocking/* diff --git a/test/conformance/enqueue/enqueue_adapter_native_cpu.match b/test/conformance/enqueue/enqueue_adapter_native_cpu.match deleted file mode 100644 index 35b9df84de..0000000000 --- a/test/conformance/enqueue/enqueue_adapter_native_cpu.match +++ /dev/null @@ -1,146 +0,0 @@ -{{OPT}}urEnqueueEventsWaitMultiDeviceTest.EmptyWaitList -{{OPT}}urEnqueueEventsWaitMultiDeviceTest.EmptyWaitListWithEvent -{{OPT}}urEnqueueEventsWaitMultiDeviceTest.EnqueueWaitOnADifferentQueue -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.Success/* -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.InvalidNullHandleProgram/* -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.InvalidNullPointerName/* -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.InvalidNullPointerDst/* -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.InvalidEventWaitListNullEvents/* -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.InvalidEventWaitListZeroSize/* -{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.InvalidEventWaitInvalidEvent/* -{{OPT}}urEnqueueDeviceGetGlobalVariableWriteTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueDeviceGetGlobalVariableWriteTest.InvalidNullHandleProgram/* -{{OPT}}urEnqueueDeviceGetGlobalVariableWriteTest.InvalidNullPointerName/* -{{OPT}}urEnqueueDeviceGetGlobalVariableWriteTest.InvalidNullPointerSrc/* -{{OPT}}urEnqueueDeviceGetGlobalVariableWriteTest.InvalidEventWaitListNullEvents/* -{{OPT}}urEnqueueDeviceGetGlobalVariableWriteTest.InvalidEventWaitListZeroSize/* -{{OPT}}urEnqueueDeviceGetGlobalVariableWriteTest.InvalidEventWaitInvalidEvent/* -{{OPT}}urEnqueueEventsWaitTest.Success/* -{{OPT}}urEnqueueEventsWaitTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest.EnqueueWaitSingleQueueMultiOps/MultiThread -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest.EnqueueWaitSingleQueueMultiOps/NoMultiThread -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest.EnqueueWaitOnAllQueues/MultiThread -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest.EnqueueWaitOnAllQueues/NoMultiThread -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest.EnqueueWaitOnAllQueuesCommonDependency/MultiThread -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest.EnqueueWaitOnAllQueuesCommonDependency/NoMultiThread -{{OPT}}urEnqueueEventsWaitWithBarrierTest.Success/* -{{OPT}}urEnqueueEventsWaitWithBarrierTest.InvalidNullPtrEventWaitList/* -urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependenciesBarrierOnly/*_ -urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependenciesLaunchOnly/*_ -urEnqueueEventsWaitWithBarrierOrderingTest.SuccessEventDependencies/*_ -urEnqueueEventsWaitWithBarrierOrderingTest.SuccessNonEventDependencies/*_ -{{OPT}}urEnqueueKernelLaunchTest.Success/* -{{OPT}}urEnqueueKernelLaunchTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueKernelLaunchTest.InvalidNullHandleKernel/* -{{OPT}}urEnqueueKernelLaunchTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueKernelLaunchTest.InvalidWorkDimension/* -{{OPT}}urEnqueueKernelLaunchTest.InvalidWorkGroupSize/* -{{OPT}}urEnqueueKernelLaunchTest.InvalidKernelArgs/* -{{OPT}}urEnqueueKernelLaunchKernelWgSizeTest.Success/* -{{OPT}}urEnqueueKernelLaunchKernelWgSizeTest.SuccessWithExplicitLocalSize/* -{{OPT}}urEnqueueKernelLaunchKernelWgSizeTest.NonMatchingLocalSize/* -{{OPT}}urEnqueueKernelLaunchKernelSubGroupTest.Success/* -{{OPT}}urEnqueueKernelLaunchKernelStandardTest.Success/* -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__1D_1 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__1D_31 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__1D_1027 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__1D_32 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__1D_256 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__2D_1_1 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__2D_31_7 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__2D_1027_1 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__2D_1_32 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__2D_256_79 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__3D_1_1_1 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__3D_31_7_1 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__3D_1027_1_19 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__3D_1_53_19 -{{OPT}}urEnqueueKernelLaunchTestWithParam.Success/*__3D_256_79_8 -{{OPT}}urEnqueueKernelLaunchWithVirtualMemory.Success/* -{{OPT}}urEnqueueKernelLaunchWithUSM.Success/* -{{OPT}}urEnqueueKernelLaunchMultiDeviceTest.KernelLaunchReadDifferentQueues/* -{{OPT}}urEnqueueKernelLaunchUSMLinkedList.Success/*__UsePoolEnabled -{{OPT}}urEnqueueKernelLaunchUSMLinkedList.Success/*__UsePoolDisabled -{{OPT}}urEnqueueMemBufferCopyRectTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemBufferCopyRectTest.InvalidSize/* -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidNullPtrEventWaitList/*__1024 -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidNullPtrEventWaitList/*__2500 -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidNullPtrEventWaitList/*__4096 -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidNullPtrEventWaitList/*__6000 -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidSize/*__1024 -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidSize/*__2500 -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidSize/*__4096 -{{OPT}}urEnqueueMemBufferCopyTestWithParam.InvalidSize/*__6000 -{{OPT}}urEnqueueMemBufferFillNegativeTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemBufferMapTestWithParam.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemBufferMapTestWithParam.InvalidSize/* -{{OPT}}urEnqueueMemBufferReadTestWithParam.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemBufferReadTestWithParam.InvalidSize/* -{{OPT}}urEnqueueMemBufferReadRectTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemBufferReadRectTest.InvalidSize/* -{{OPT}}urEnqueueMemBufferWriteTestWithParam.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemBufferWriteTestWithParam.InvalidSize/* -{{OPT}}urEnqueueMemBufferWriteRectTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemBufferWriteRectTest.InvalidSize/* -{{OPT}}urEnqueueMemImageCopyTest.Success/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopy/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithSrcOffset/* -{{OPT}}urEnqueueMemImageCopyTest.SuccessPartialCopyWithDstOffset/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleImageSrc/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullHandleImageDst/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueMemImageCopyTest.InvalidSize/* -{{OPT}}urEnqueueMemUnmapTestWithParam.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueUSMFillTestWithParam.Success/* -{{OPT}}urEnqueueUSMFillNegativeTest.InvalidNullQueueHandle/* -{{OPT}}urEnqueueUSMFillNegativeTest.InvalidNullPtr/* -{{OPT}}urEnqueueUSMFillNegativeTest.InvalidSize/* -{{OPT}}urEnqueueUSMFillNegativeTest.OutOfBounds/* -{{OPT}}urEnqueueUSMFillNegativeTest.invalidPatternSize/* -{{OPT}}urEnqueueUSMFillNegativeTest.InvalidEventWaitList/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.InvalidNullQueueHandle/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.InvalidNullPtr/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.InvalidPitch/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.InvalidWidth/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.InvalidHeight/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.InvalidSize/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.OutOfBounds/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.invalidPatternSize/* -{{OPT}}urEnqueueUSMFill2DNegativeTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueUSMAdviseWithParamTest.Success/*__UR_USM_ADVICE_FLAG_DEFAULT -{{OPT}}urEnqueueUSMAdviseTest.MultipleParamsSuccess/* -{{OPT}}urEnqueueUSMAdviseTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueUSMAdviseTest.InvalidNullPointerMem/* -{{OPT}}urEnqueueUSMAdviseTest.InvalidEnumeration/* -{{OPT}}urEnqueueUSMAdviseTest.InvalidSizeZero/* -{{OPT}}urEnqueueUSMAdviseTest.InvalidSizeTooLarge/* -{{OPT}}urEnqueueUSMAdviseTest.NonCoherentDeviceMemorySuccessOrWarning/* -{{OPT}}urEnqueueUSMMemcpyTest.Blocking/* -{{OPT}}urEnqueueUSMMemcpyTest.BlockingWithEvent/* -{{OPT}}urEnqueueUSMMemcpyTest.NonBlocking/* -{{OPT}}urEnqueueUSMMemcpyTest.WaitForDependencies/* -{{OPT}}urEnqueueUSMMemcpyTest.InvalidNullQueueHandle/* -{{OPT}}urEnqueueUSMMemcpyTest.InvalidNullDst/* -{{OPT}}urEnqueueUSMMemcpyTest.InvalidNullSrc/* -{{OPT}}urEnqueueUSMMemcpyTest.InvalidNullPtrEventWaitList/* -{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessBlocking/* -{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessNonBlocking/* -{{OPT}}urEnqueueUSMMemcpy2DNegativeTest.InvalidNullHandleQueue/*__pitch__1__width__1__height__1__src__UR_USM_TYPE_DEVICE__dst__UR_USM_TYPE_DEVICE -{{OPT}}urEnqueueUSMMemcpy2DNegativeTest.InvalidNullPointer/*__pitch__1__width__1__height__1__src__UR_USM_TYPE_DEVICE__dst__UR_USM_TYPE_DEVICE -{{OPT}}urEnqueueUSMMemcpy2DNegativeTest.InvalidSize/*__pitch__1__width__1__height__1__src__UR_USM_TYPE_DEVICE__dst__UR_USM_TYPE_DEVICE -{{OPT}}urEnqueueUSMMemcpy2DNegativeTest.InvalidEventWaitList/*__pitch__1__width__1__height__1__src__UR_USM_TYPE_DEVICE__dst__UR_USM_TYPE_DEVICE -{{OPT}}urEnqueueUSMPrefetchWithParamTest.Success/*__UR_USM_MIGRATION_FLAG_DEFAULT -{{OPT}}urEnqueueUSMPrefetchWithParamTest.CheckWaitEvent/*__UR_USM_MIGRATION_FLAG_DEFAULT -{{OPT}}urEnqueueUSMPrefetchTest.InvalidNullHandleQueue/* -{{OPT}}urEnqueueUSMPrefetchTest.InvalidNullPointerMem/* -{{OPT}}urEnqueueUSMPrefetchTest.InvalidEnumeration/* -{{OPT}}urEnqueueUSMPrefetchTest.InvalidSizeZero/* -{{OPT}}urEnqueueUSMPrefetchTest.InvalidSizeTooLarge/* -{{OPT}}urEnqueueUSMPrefetchTest.InvalidEventWaitList/* -urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/* -urEnqueueKernelLaunchIncrementMultiDeviceTest.Success/* -urEnqueueKernelLaunchIncrementTest.Success/* -# This one is flakey -{{OPT}}urEnqueueMemBufferReadTestWithParam.NonBlocking/* diff --git a/test/conformance/enqueue/enqueue_adapter_opencl.match b/test/conformance/enqueue/enqueue_adapter_opencl.match deleted file mode 100644 index 7f0e36cd6c..0000000000 --- a/test/conformance/enqueue/enqueue_adapter_opencl.match +++ /dev/null @@ -1,3 +0,0 @@ -# Note: This file is only for use with cts_exe.py -# Fails when -fsanitize=cfi -{{OPT}}urEnqueueEventsWaitMultiDeviceMTTest.EnqueueWaitOnAllQueues/MultiThread diff --git a/test/conformance/enqueue/helpers.h b/test/conformance/enqueue/helpers.h index 2cdf383586..042f36adeb 100644 --- a/test/conformance/enqueue/helpers.h +++ b/test/conformance/enqueue/helpers.h @@ -28,7 +28,7 @@ template inline std::string printRectTestString(const testing::TestParamInfo &info) { // ParamType will be std::tuple - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = GetPlatformAndDeviceName(device_handle); const auto &test_name = std::get<1>(info.param).name; return platform_device_name + "__" + test_name; @@ -69,7 +69,7 @@ struct TestParameters2D { template inline std::string print2DTestString(const testing::TestParamInfo &info) { - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; @@ -117,7 +117,7 @@ template inline std::string printMemBufferTestString( const testing::TestParamInfo &info) { // ParamType will be std::tuple - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = GetPlatformAndDeviceName(device_handle); std::stringstream ss; @@ -132,7 +132,7 @@ template inline std::string printMemBufferMapWriteTestString( const testing::TestParamInfo &info) { // ParamType will be std::tuple - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = GetPlatformAndDeviceName(device_handle); std::stringstream ss; @@ -144,7 +144,7 @@ inline std::string printMemBufferMapWriteTestString( template inline std::string printFillTestString(const testing::TestParamInfo &info) { - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; @@ -154,10 +154,20 @@ printFillTestString(const testing::TestParamInfo &info) { return test_name.str(); } -struct urMultiQueueMultiDeviceTest : uur::urMultiDeviceContextTestTemplate<1> { - void initQueues(std::vector srcDevices, - size_t numDuplicate) { - for (size_t i = 0; i < numDuplicate; i++) { +// Similar to urMultiDeviceContextTestWithParam this fixture allows a min +// device count to be specified, but in this case we duplicate existing +// devices to reach the min device count rather than skipping if it isn't met. +template +struct urMultiQueueMultiDeviceTest : uur::urAllDevicesTest { + void SetUp() override { + UUR_RETURN_ON_FATAL_FAILURE(uur::urAllDevicesTest::SetUp()); + + ASSERT_SUCCESS( + urContextCreate(devices.size(), devices.data(), nullptr, &context)); + + // Duplicate our devices until we hit the minimum size specified. + auto srcDevices = devices; + while (devices.size() < minDevices) { devices.insert(devices.end(), srcDevices.begin(), srcDevices.end()); } @@ -168,19 +178,38 @@ struct urMultiQueueMultiDeviceTest : uur::urMultiDeviceContextTestTemplate<1> { } } - // Default implementation that uses all available devices - void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE( - uur::urMultiDeviceContextTestTemplate<1>::SetUp()); - initQueues(uur::KernelsEnvironment::instance->devices, 1); + void TearDown() override { + for (auto &queue : queues) { + EXPECT_SUCCESS(urQueueRelease(queue)); + } + UUR_RETURN_ON_FATAL_FAILURE(uur::urAllDevicesTest::TearDown()); } - // Specialized implementation that duplicates all devices and queues - void SetUp(std::vector srcDevices, - size_t numDuplicate) { - UUR_RETURN_ON_FATAL_FAILURE( - uur::urMultiDeviceContextTestTemplate<1>::SetUp()); - initQueues(srcDevices, numDuplicate); + ur_context_handle_t context; + std::vector queues; +}; + +template +struct urMultiQueueMultiDeviceTestWithParam + : uur::urAllDevicesTestWithParam { + using uur::urAllDevicesTestWithParam::devices; + void SetUp() override { + UUR_RETURN_ON_FATAL_FAILURE(uur::urAllDevicesTestWithParam::SetUp()); + + ASSERT_SUCCESS( + urContextCreate(devices.size(), devices.data(), nullptr, &context)); + + // Duplicate our devices until we hit the minimum size specified. + auto srcDevices = devices; + while (devices.size() < minDevices) { + devices.insert(devices.end(), srcDevices.begin(), srcDevices.end()); + } + + for (auto &device : devices) { + ur_queue_handle_t queue = nullptr; + ASSERT_SUCCESS(urQueueCreate(context, device, nullptr, &queue)); + queues.push_back(queue); + } } void TearDown() override { @@ -188,13 +217,10 @@ struct urMultiQueueMultiDeviceTest : uur::urMultiDeviceContextTestTemplate<1> { EXPECT_SUCCESS(urQueueRelease(queue)); } UUR_RETURN_ON_FATAL_FAILURE( - uur::urMultiDeviceContextTestTemplate<1>::TearDown()); + uur::urAllDevicesTestWithParam::TearDown()); } - std::function, - std::vector>(void)> - makeQueues; - std::vector devices; + ur_context_handle_t context; std::vector queues; }; diff --git a/test/conformance/enqueue/urEnqueueEventsWait.cpp b/test/conformance/enqueue/urEnqueueEventsWait.cpp index 3d71200008..484cf354b0 100644 --- a/test/conformance/enqueue/urEnqueueEventsWait.cpp +++ b/test/conformance/enqueue/urEnqueueEventsWait.cpp @@ -2,7 +2,9 @@ // Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include +#include struct urEnqueueEventsWaitTest : uur::urMultiQueueTest { void SetUp() override { @@ -37,6 +39,8 @@ struct urEnqueueEventsWaitTest : uur::urMultiQueueTest { UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueEventsWaitTest); TEST_P(urEnqueueEventsWaitTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ur_event_handle_t event1 = nullptr; ur_event_handle_t waitEvent = nullptr; ASSERT_SUCCESS(urEnqueueMemBufferCopy(queue1, src_buffer, dst_buffer, 0, 0, diff --git a/test/conformance/enqueue/urEnqueueEventsWaitMultiDevice.cpp b/test/conformance/enqueue/urEnqueueEventsWaitMultiDevice.cpp index 80da446814..30015068cd 100644 --- a/test/conformance/enqueue/urEnqueueEventsWaitMultiDevice.cpp +++ b/test/conformance/enqueue/urEnqueueEventsWaitMultiDevice.cpp @@ -4,27 +4,32 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" +#include "uur/known_failure.h" #include #include #include -struct urEnqueueEventsWaitMultiDeviceTest : uur::urMultiQueueMultiDeviceTest { - void SetUp() override { SetUp(2); /* we need at least 2 devices */ } +void checkDevicesSupportSharedUSM( + const std::vector &devices) { + for (auto device : devices) { + ur_device_usm_access_capability_flags_t shared_usm_single = 0; + EXPECT_SUCCESS( + uur::GetDeviceUSMSingleSharedSupport(device, shared_usm_single)); + if (!shared_usm_single) { + GTEST_SKIP() << "Shared USM is not supported by the device."; + } + } +} - void SetUp(size_t numDuplicateDevices) { - UUR_RETURN_ON_FATAL_FAILURE(uur::urMultiQueueMultiDeviceTest::SetUp( - uur::KernelsEnvironment::instance->devices, numDuplicateDevices)); +struct urEnqueueEventsWaitMultiDeviceTest + : uur::urMultiQueueMultiDeviceTest<2> { + void SetUp() override { + UUR_RETURN_ON_FATAL_FAILURE( + uur::urMultiQueueMultiDeviceTest<2>::SetUp()); - for (auto device : devices) { - ur_device_usm_access_capability_flags_t shared_usm_single = 0; - EXPECT_SUCCESS(uur::GetDeviceUSMSingleSharedSupport( - device, shared_usm_single)); - if (!shared_usm_single) { - GTEST_SKIP() << "Shared USM is not supported by the device."; - } - } + checkDevicesSupportSharedUSM(devices); ptrs.resize(devices.size()); for (size_t i = 0; i < devices.size(); i++) { @@ -40,7 +45,7 @@ struct urEnqueueEventsWaitMultiDeviceTest : uur::urMultiQueueMultiDeviceTest { } } UUR_RETURN_ON_FATAL_FAILURE( - uur::urMultiQueueMultiDeviceTest::TearDown()); + uur::urMultiQueueMultiDeviceTest<2>::TearDown()); } void initData() { @@ -61,8 +66,9 @@ struct urEnqueueEventsWaitMultiDeviceTest : uur::urMultiQueueMultiDeviceTest { std::vector ptrs; }; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueEventsWaitMultiDeviceTest); -TEST_F(urEnqueueEventsWaitMultiDeviceTest, EmptyWaitList) { +TEST_P(urEnqueueEventsWaitMultiDeviceTest, EmptyWaitList) { initData(); ASSERT_SUCCESS(urEnqueueUSMMemcpy(queues[0], false, ptrs[1], ptrs[0], size, @@ -73,7 +79,7 @@ TEST_F(urEnqueueEventsWaitMultiDeviceTest, EmptyWaitList) { verifyData(ptrs[1], pattern); } -TEST_F(urEnqueueEventsWaitMultiDeviceTest, EmptyWaitListWithEvent) { +TEST_P(urEnqueueEventsWaitMultiDeviceTest, EmptyWaitListWithEvent) { initData(); ASSERT_SUCCESS(urEnqueueUSMMemcpy(queues[0], false, ptrs[1], ptrs[0], size, @@ -86,7 +92,7 @@ TEST_F(urEnqueueEventsWaitMultiDeviceTest, EmptyWaitListWithEvent) { verifyData(ptrs[1], pattern); } -TEST_F(urEnqueueEventsWaitMultiDeviceTest, EnqueueWaitOnADifferentQueue) { +TEST_P(urEnqueueEventsWaitMultiDeviceTest, EnqueueWaitOnADifferentQueue) { initData(); uur::raii::Event event; @@ -99,10 +105,9 @@ TEST_F(urEnqueueEventsWaitMultiDeviceTest, EnqueueWaitOnADifferentQueue) { } struct urEnqueueEventsWaitMultiDeviceMTTest - : urEnqueueEventsWaitMultiDeviceTest, - testing::WithParamInterface { + : uur::urMultiQueueMultiDeviceTestWithParam<8, uur::BoolTestParam> { void doComputation(std::function work) { - auto multiThread = GetParam().value; + auto multiThread = getParam().value; std::vector threads; for (size_t i = 0; i < devices.size(); i++) { if (multiThread) { @@ -117,29 +122,50 @@ struct urEnqueueEventsWaitMultiDeviceMTTest } void SetUp() override { - const size_t numDuplicateDevices = 8; - UUR_RETURN_ON_FATAL_FAILURE( - urEnqueueEventsWaitMultiDeviceTest::SetUp(numDuplicateDevices)); + UUR_RETURN_ON_FATAL_FAILURE(uur::urMultiQueueMultiDeviceTestWithParam< + 8, uur::BoolTestParam>::SetUp()); + checkDevicesSupportSharedUSM(devices); + + ptrs.resize(devices.size()); + for (size_t i = 0; i < devices.size(); i++) { + EXPECT_SUCCESS(urUSMSharedAlloc(context, devices[i], nullptr, + nullptr, size, &ptrs[i])); + } } - void TearDown() override { urEnqueueEventsWaitMultiDeviceTest::TearDown(); } -}; + void TearDown() override { + for (auto ptr : ptrs) { + if (ptr) { + EXPECT_SUCCESS(urUSMFree(context, ptr)); + } + } + UUR_RETURN_ON_FATAL_FAILURE(uur::urMultiQueueMultiDeviceTestWithParam< + 8, uur::BoolTestParam>::TearDown()); + } + + void initData() { + EXPECT_SUCCESS(urEnqueueUSMFill(queues[0], ptrs[0], sizeof(pattern), + &pattern, size, 0, nullptr, nullptr)); + EXPECT_SUCCESS(urQueueFinish(queues[0])); + } -template -inline std::string -printParams(const testing::TestParamInfo &info) { - std::stringstream ss; + void verifyData(void *ptr, uint32_t pattern) { + for (size_t i = 0; i < count; i++) { + ASSERT_EQ(reinterpret_cast(ptr)[i], pattern); + } + } - auto param1 = info.param; - ss << (param1.value ? "" : "No") << param1.name; + uint32_t pattern = 42; + const size_t count = 1024; + const size_t size = sizeof(uint32_t) * count; - return ss.str(); -} + std::vector ptrs; +}; -INSTANTIATE_TEST_SUITE_P( - , urEnqueueEventsWaitMultiDeviceMTTest, +UUR_PLATFORM_TEST_SUITE_P( + urEnqueueEventsWaitMultiDeviceMTTest, testing::ValuesIn(uur::BoolTestParam::makeBoolParam("MultiThread")), - printParams); + uur::platformTestWithParamPrinter); TEST_P(urEnqueueEventsWaitMultiDeviceMTTest, EnqueueWaitSingleQueueMultiOps) { std::vector data(count, pattern); @@ -163,6 +189,11 @@ TEST_P(urEnqueueEventsWaitMultiDeviceMTTest, EnqueueWaitSingleQueueMultiOps) { } TEST_P(urEnqueueEventsWaitMultiDeviceMTTest, EnqueueWaitOnAllQueues) { + // This is a flaky fail when UR_CONFORMANCE_TEST_LOADER=ON + if (getParam().value) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{}); + } + std::vector eventsRaii(devices.size()); std::vector events(devices.size()); auto work = [this, &events, &eventsRaii](size_t i) { diff --git a/test/conformance/enqueue/urEnqueueEventsWaitWithBarrier.cpp b/test/conformance/enqueue/urEnqueueEventsWaitWithBarrier.cpp index ca464b48dd..c70c2f31bc 100644 --- a/test/conformance/enqueue/urEnqueueEventsWaitWithBarrier.cpp +++ b/test/conformance/enqueue/urEnqueueEventsWaitWithBarrier.cpp @@ -3,6 +3,7 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include enum class BarrierType { Normal, @@ -71,10 +72,10 @@ struct urEnqueueEventsWaitWithBarrierTest std::vector input; }; -UUR_TEST_SUITE_P(urEnqueueEventsWaitWithBarrierTest, - ::testing::Values(BarrierType::Normal, - BarrierType::ExtLowPower), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urEnqueueEventsWaitWithBarrierTest, + ::testing::Values(BarrierType::Normal, + BarrierType::ExtLowPower), + uur::deviceTestWithParamPrinter); struct urEnqueueEventsWaitWithBarrierOrderingTest : uur::urProgramTest { void SetUp() override { @@ -103,6 +104,8 @@ struct urEnqueueEventsWaitWithBarrierOrderingTest : uur::urProgramTest { UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueEventsWaitWithBarrierOrderingTest); TEST_P(urEnqueueEventsWaitWithBarrierTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ur_event_handle_t event1 = nullptr; ur_event_handle_t waitEvent = nullptr; ASSERT_SUCCESS(urEnqueueMemBufferCopy(queue1, src_buffer, dst_buffer, 0, 0, @@ -160,6 +163,8 @@ TEST_P(urEnqueueEventsWaitWithBarrierTest, InvalidNullPtrEventWaitList) { TEST_P(urEnqueueEventsWaitWithBarrierOrderingTest, SuccessEventDependenciesBarrierOnly) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + constexpr size_t offset = 0; constexpr size_t count = 1; ur_event_handle_t event; @@ -192,6 +197,8 @@ TEST_P(urEnqueueEventsWaitWithBarrierOrderingTest, TEST_P(urEnqueueEventsWaitWithBarrierOrderingTest, SuccessEventDependenciesLaunchOnly) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + constexpr size_t offset = 0; constexpr size_t count = 1; ur_event_handle_t event; @@ -223,6 +230,8 @@ TEST_P(urEnqueueEventsWaitWithBarrierOrderingTest, } TEST_P(urEnqueueEventsWaitWithBarrierOrderingTest, SuccessEventDependencies) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + constexpr size_t offset = 0; constexpr size_t count = 1; ur_event_handle_t event[6]; @@ -255,6 +264,8 @@ TEST_P(urEnqueueEventsWaitWithBarrierOrderingTest, SuccessEventDependencies) { TEST_P(urEnqueueEventsWaitWithBarrierOrderingTest, SuccessNonEventDependencies) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + constexpr size_t offset = 0; constexpr size_t count = 1; diff --git a/test/conformance/enqueue/urEnqueueKernelLaunch.cpp b/test/conformance/enqueue/urEnqueueKernelLaunch.cpp index 7ffa072466..803dd2b79d 100644 --- a/test/conformance/enqueue/urEnqueueKernelLaunch.cpp +++ b/test/conformance/enqueue/urEnqueueKernelLaunch.cpp @@ -5,6 +5,7 @@ #include #include +#include struct urEnqueueKernelLaunchTest : uur::urKernelExecutionTest { void SetUp() override { @@ -36,6 +37,11 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueKernelLaunchKernelWgSizeTest); // Note: Due to an issue with HIP, the subgroup test is not generated struct urEnqueueKernelLaunchKernelSubGroupTest : uur::urKernelExecutionTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + program_name = "subgroup"; UUR_RETURN_ON_FATAL_FAILURE(urKernelExecutionTest::SetUp()); } @@ -133,6 +139,12 @@ TEST_P(urEnqueueKernelLaunchTest, InvalidWorkGroupSize) { } TEST_P(urEnqueueKernelLaunchTest, InvalidKernelArgs) { + // Cuda and hip both lack any way to validate kernel args + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + ur_platform_backend_t backend; ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, sizeof(ur_platform_backend_t), &backend, @@ -152,6 +164,11 @@ TEST_P(urEnqueueKernelLaunchTest, InvalidKernelArgs) { } TEST_P(urEnqueueKernelLaunchKernelWgSizeTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + ASSERT_SUCCESS(urEnqueueKernelLaunch( queue, kernel, n_dimensions, global_offset.data(), global_size.data(), nullptr, 0, nullptr, nullptr)); @@ -166,6 +183,9 @@ TEST_P(urEnqueueKernelLaunchKernelWgSizeTest, SuccessWithExplicitLocalSize) { } TEST_P(urEnqueueKernelLaunchKernelWgSizeTest, NonMatchingLocalSize) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + std::array wrong_wg_size{8, 8, 8}; ASSERT_EQ_RESULT( urEnqueueKernelLaunch(queue, kernel, n_dimensions, global_offset.data(), @@ -175,6 +195,10 @@ TEST_P(urEnqueueKernelLaunchKernelWgSizeTest, NonMatchingLocalSize) { } TEST_P(urEnqueueKernelLaunchKernelSubGroupTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + ur_mem_handle_t buffer = nullptr; AddBuffer1DArg(sizeof(size_t), &buffer); ASSERT_SUCCESS(urEnqueueKernelLaunch( @@ -216,7 +240,7 @@ struct testParametersEnqueueKernel { template inline std::string printKernelLaunchTestString( const testing::TestParamInfo &info) { - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; @@ -283,7 +307,7 @@ static std::vector test_cases{// 1D {1027, 1, 19, 3}, {1, 53, 19, 3}, {256, 79, 8, 3}}; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueKernelLaunchTestWithParam, testing::ValuesIn(test_cases), printKernelLaunchTestString); @@ -424,6 +448,8 @@ struct urEnqueueKernelLaunchWithVirtualMemory : uur::urKernelExecutionTest { UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueKernelLaunchWithVirtualMemory); TEST_P(urEnqueueKernelLaunchWithVirtualMemory, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + size_t work_dim = 1; size_t global_offset = 0; size_t global_size = alloc_size / sizeof(uint32_t); @@ -449,7 +475,8 @@ TEST_P(urEnqueueKernelLaunchWithVirtualMemory, Success) { ASSERT_EQ(fill_val, data.at(i)); } } - +/* this is not a proper multi device test, making it one might require a whole + * parallel chain on multi device fixtures for kernel struct urEnqueueKernelLaunchMultiDeviceTest : public urEnqueueKernelLaunchTest { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urEnqueueKernelLaunchTest::SetUp()); @@ -475,6 +502,8 @@ 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) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + ur_mem_handle_t buffer = nullptr; AddBuffer1DArg(sizeof(val) * global_size, &buffer); AddPodArg(val); @@ -496,7 +525,7 @@ TEST_P(urEnqueueKernelLaunchMultiDeviceTest, KernelLaunchReadDifferentQueues) { nullptr, nullptr)); ASSERT_EQ(val, output) << "Result on queue " << i << " did not match!"; } -} +}*/ struct urEnqueueKernelLaunchUSMLinkedList : uur::urKernelTestWithParam { @@ -555,12 +584,16 @@ struct urEnqueueKernelLaunchUSMLinkedList ur_queue_handle_t queue = nullptr; }; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueKernelLaunchUSMLinkedList, testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), uur::deviceTestWithParamPrinter); TEST_P(urEnqueueKernelLaunchUSMLinkedList, Success) { + if (use_pool) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + } + ur_device_usm_access_capability_flags_t shared_usm_flags = 0; ASSERT_SUCCESS( uur::GetDeviceUSMSingleSharedSupport(device, shared_usm_flags)); diff --git a/test/conformance/enqueue/urEnqueueKernelLaunchAndMemcpyInOrder.cpp b/test/conformance/enqueue/urEnqueueKernelLaunchAndMemcpyInOrder.cpp index b6306f1693..1a75316a32 100644 --- a/test/conformance/enqueue/urEnqueueKernelLaunchAndMemcpyInOrder.cpp +++ b/test/conformance/enqueue/urEnqueueKernelLaunchAndMemcpyInOrder.cpp @@ -6,6 +6,7 @@ #include "helpers.h" #include +#include #include #include @@ -14,9 +15,9 @@ // There was a bug in previous L0 drivers that caused the test to fail std::tuple minL0DriverVersion = {1, 3, 29534}; -template -struct urMultiQueueLaunchMemcpyTest : uur::urMultiQueueMultiDeviceTest, - testing::WithParamInterface { +template +struct urMultiQueueLaunchMemcpyTest + : uur::urMultiQueueMultiDeviceTestWithParam { std::string KernelName; std::vector programs; std::vector kernels; @@ -26,12 +27,17 @@ struct urMultiQueueLaunchMemcpyTest : uur::urMultiQueueMultiDeviceTest, static constexpr size_t ArraySize = 100; static constexpr uint32_t InitialValue = 1; - void SetUp() override { throw std::runtime_error("Not implemented"); } + using uur::urMultiQueueMultiDeviceTestWithParam::devices; + using uur::urMultiQueueMultiDeviceTestWithParam::platform; + using uur::urMultiQueueMultiDeviceTestWithParam::context; + using uur::urMultiQueueMultiDeviceTestWithParam::queues; + + void SetUp() override { + // We haven't got device code tests working on native cpu yet. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); - void SetUp(std::vector srcDevices, - size_t duplicateDevices) { - UUR_RETURN_ON_FATAL_FAILURE(uur::urMultiQueueMultiDeviceTest::SetUp( - srcDevices, duplicateDevices)); + UUR_RETURN_ON_FATAL_FAILURE( + uur::urMultiQueueMultiDeviceTestWithParam::SetUp()); for (auto &device : devices) { SKIP_IF_DRIVER_TOO_OLD("Level-Zero", minL0DriverVersion, platform, @@ -93,7 +99,8 @@ struct urMultiQueueLaunchMemcpyTest : uur::urMultiQueueMultiDeviceTest, urProgramRelease(program); } UUR_RETURN_ON_FATAL_FAILURE( - uur::urMultiDeviceContextTestTemplate<1>::TearDown()); + uur::urMultiQueueMultiDeviceTestWithParam::TearDown()); } void runBackgroundCheck(std::vector &Events) { @@ -122,60 +129,62 @@ struct urMultiQueueLaunchMemcpyTest : uur::urMultiQueueMultiDeviceTest, template struct urEnqueueKernelLaunchIncrementMultiDeviceTestWithParam - : public urMultiQueueLaunchMemcpyTest { + : public urMultiQueueLaunchMemcpyTest<8, Param> { static constexpr size_t duplicateDevices = 8; - using urMultiQueueLaunchMemcpyTest::context; - using urMultiQueueLaunchMemcpyTest::queues; - using urMultiQueueLaunchMemcpyTest::devices; - using urMultiQueueLaunchMemcpyTest::kernels; - using urMultiQueueLaunchMemcpyTest::SharedMem; + using urMultiQueueLaunchMemcpyTest::context; + using urMultiQueueLaunchMemcpyTest::queues; + using urMultiQueueLaunchMemcpyTest::devices; + using urMultiQueueLaunchMemcpyTest::kernels; + using urMultiQueueLaunchMemcpyTest::SharedMem; void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueLaunchMemcpyTest::SetUp( - uur::KernelsEnvironment::instance->devices, duplicateDevices)); + UUR_RETURN_ON_FATAL_FAILURE( + urMultiQueueLaunchMemcpyTest::SetUp()); } void TearDown() override { UUR_RETURN_ON_FATAL_FAILURE( - urMultiQueueLaunchMemcpyTest::TearDown()); + urMultiQueueLaunchMemcpyTest::TearDown()); } }; struct urEnqueueKernelLaunchIncrementTest - : urMultiQueueLaunchMemcpyTest< - std::tuple> { + : urMultiQueueLaunchMemcpyTest<50, uur::BoolTestParam> { static constexpr size_t numOps = 50; - using Param = std::tuple; - using urMultiQueueLaunchMemcpyTest::context; - using urMultiQueueLaunchMemcpyTest::queues; - using urMultiQueueLaunchMemcpyTest::devices; - using urMultiQueueLaunchMemcpyTest::kernels; - using urMultiQueueLaunchMemcpyTest::SharedMem; + using Param = uur::BoolTestParam; + + using urMultiQueueLaunchMemcpyTest::context; + using urMultiQueueLaunchMemcpyTest::queues; + using urMultiQueueLaunchMemcpyTest::devices; + using urMultiQueueLaunchMemcpyTest::kernels; + using urMultiQueueLaunchMemcpyTest::SharedMem; void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urMultiQueueLaunchMemcpyTest::SetUp( - std::vector{std::get<0>(GetParam())}, - numOps)); // Use single device, duplicated numOps times + UUR_RETURN_ON_FATAL_FAILURE( + urMultiQueueLaunchMemcpyTest:: + SetUp()); // Use single device, duplicated numOps times } void TearDown() override { UUR_RETURN_ON_FATAL_FAILURE( - urMultiQueueLaunchMemcpyTest::TearDown()); + urMultiQueueLaunchMemcpyTest::TearDown()); } }; -UUR_TEST_SUITE_P( +UUR_PLATFORM_TEST_SUITE_P( urEnqueueKernelLaunchIncrementTest, testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UseEvents")), - uur::deviceTestWithParamPrinter); + uur::platformTestWithParamPrinter); TEST_P(urEnqueueKernelLaunchIncrementTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + constexpr size_t global_offset = 0; constexpr size_t n_dimensions = 1; - auto useEvents = std::get<1>(GetParam()).value; + auto useEvents = getParam().value; std::vector kernelEvents(numOps); std::vector memcpyEvents(numOps - 1); @@ -229,25 +238,30 @@ inline std::string printParams(const testing::TestParamInfo &info) { std::stringstream ss; - auto param1 = std::get<0>(info.param); + auto boolParamTuple = std::get<1>(info.param); + + auto param1 = std::get<0>(boolParamTuple); ss << (param1.value ? "" : "No") << param1.name; - auto param2 = std::get<1>(info.param); + auto param2 = std::get<1>(boolParamTuple); ss << (param2.value ? "" : "No") << param2.name; if constexpr (std::tuple_size_v < typename T::ParamType >> 2) { auto param3 = std::get<2>(info.param); } - return ss.str(); + auto platform = std::get<0>(info.param); + + return uur::GetPlatformNameWithID(platform) + "__" + + uur::GTestSanitizeString(ss.str()); } using urEnqueueKernelLaunchIncrementMultiDeviceTest = urEnqueueKernelLaunchIncrementMultiDeviceTestWithParam< std::tuple>; -INSTANTIATE_TEST_SUITE_P( - , urEnqueueKernelLaunchIncrementMultiDeviceTest, +UUR_PLATFORM_TEST_SUITE_P( + urEnqueueKernelLaunchIncrementMultiDeviceTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UseEventWait")), testing::ValuesIn( @@ -256,8 +270,10 @@ INSTANTIATE_TEST_SUITE_P( // Do a chain of kernelLaunch(dev0) -> memcpy(dev0, dev1) -> kernelLaunch(dev1) ... ops TEST_P(urEnqueueKernelLaunchIncrementMultiDeviceTest, Success) { - auto waitOnEvent = std::get<0>(GetParam()).value; - auto runBackgroundCheck = std::get<1>(GetParam()).value; + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + + auto waitOnEvent = std::get<0>(getParam()).value; + auto runBackgroundCheck = std::get<1>(getParam()).value; size_t returned_size; ASSERT_SUCCESS(urDeviceGetInfo(devices[0], UR_DEVICE_INFO_EXTENSIONS, 0, @@ -333,8 +349,8 @@ using urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest = urEnqueueKernelLaunchIncrementMultiDeviceTestWithParam< std::tuple>; -INSTANTIATE_TEST_SUITE_P( - , urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest, +UUR_PLATFORM_TEST_SUITE_P( + urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UseEvents")), testing::ValuesIn(uur::BoolTestParam::makeBoolParam("QueuePerThread"))), @@ -348,8 +364,8 @@ TEST_P(urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest, Success) { static constexpr size_t numOpsPerThread = 6; - auto useEvents = std::get<0>(GetParam()).value; - auto queuePerThread = std::get<1>(GetParam()).value; + auto useEvents = std::get<0>(getParam()).value; + auto queuePerThread = std::get<1>(getParam()).value; for (size_t i = 0; i < numThreads; i++) { threads.emplace_back([this, i, queuePerThread, useEvents]() { diff --git a/test/conformance/enqueue/urEnqueueMemBufferCopy.cpp b/test/conformance/enqueue/urEnqueueMemBufferCopy.cpp index ad73d4aa69..ab26845381 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferCopy.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferCopy.cpp @@ -5,6 +5,7 @@ #include "helpers.h" #include +#include struct urEnqueueMemBufferCopyTestWithParam : uur::urQueueTestWithParam { void SetUp() override { @@ -38,11 +39,13 @@ struct urEnqueueMemBufferCopyTestWithParam : uur::urQueueTestWithParam { static std::vector test_parameters{1024, 2500, 4096, 6000}; -UUR_TEST_SUITE_P(urEnqueueMemBufferCopyTestWithParam, - ::testing::ValuesIn(test_parameters), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urEnqueueMemBufferCopyTestWithParam, + ::testing::ValuesIn(test_parameters), + uur::deviceTestWithParamPrinter); TEST_P(urEnqueueMemBufferCopyTestWithParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEnqueueMemBufferCopy(queue, src_buffer, dst_buffer, 0, 0, size, 0, nullptr, nullptr)); std::vector output(count, 1); @@ -90,6 +93,8 @@ TEST_P(urEnqueueMemBufferCopyTestWithParam, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemBufferCopyTestWithParam, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urEnqueueMemBufferCopy(queue, src_buffer, dst_buffer, 1, 0, size, 0, nullptr, nullptr)); @@ -100,8 +105,9 @@ TEST_P(urEnqueueMemBufferCopyTestWithParam, InvalidSize) { using urEnqueueMemBufferCopyMultiDeviceTest = uur::urMultiDeviceMemBufferQueueTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueMemBufferCopyMultiDeviceTest); -TEST_F(urEnqueueMemBufferCopyMultiDeviceTest, CopyReadDifferentQueues) { +TEST_P(urEnqueueMemBufferCopyMultiDeviceTest, CopyReadDifferentQueues) { // First queue does a fill. const uint32_t input = 42; ASSERT_SUCCESS(urEnqueueMemBufferFill(queues[0], buffer, &input, diff --git a/test/conformance/enqueue/urEnqueueMemBufferCopyRect.cpp b/test/conformance/enqueue/urEnqueueMemBufferCopyRect.cpp index 8c7fe5d430..6d8ec4940f 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferCopyRect.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferCopyRect.cpp @@ -3,6 +3,7 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" +#include "uur/known_failure.h" #include static std::vector generateParameterizations() { @@ -45,22 +46,22 @@ static std::vector generateParameterizations() { 256, 256, 256, 512); // Tests that a 8x8x8 region can be read from a 8x8x8 device buffer at // offset {0,0,0} to a 8x8x8 host buffer at offset {0,0,0}. - PARAMETERIZATION(copy_3d, 512, 512, (ur_rect_offset_t{0, 0, 0}), + PARAMETERIZATION(copy_3D, 512, 512, (ur_rect_offset_t{0, 0, 0}), (ur_rect_offset_t{0, 0, 0}), (ur_rect_region_t{8, 8, 8}), 8, 64, 8, 64); // Tests that a 4x3x2 region can be read from a 8x8x8 device buffer at // offset {1,2,3} to a 8x8x8 host buffer at offset {4,1,3}. - PARAMETERIZATION(copy_3d_with_offsets, 512, 512, + PARAMETERIZATION(copy_3D_with_offsets, 512, 512, (ur_rect_offset_t{1, 2, 3}), (ur_rect_offset_t{4, 1, 3}), (ur_rect_region_t{4, 3, 2}), 8, 64, 8, 64); // Tests that a 4x16x2 region can be read from a 8x32x1 device buffer at // offset {1,2,0} to a 8x32x4 host buffer at offset {4,1,3}. - PARAMETERIZATION(copy_2d_3d, 256, 1024, (ur_rect_offset_t{1, 2, 0}), + PARAMETERIZATION(copy_2D_3D, 256, 1024, (ur_rect_offset_t{1, 2, 0}), (ur_rect_offset_t{4, 1, 3}), (ur_rect_region_t{4, 16, 1}), 8, 256, 8, 256); // Tests that a 1x4x1 region can be read from a 8x16x4 device buffer at // offset {7,3,3} to a 2x8x1 host buffer at offset {1,3,0}. - PARAMETERIZATION(copy_3d_2d, 512, 16, (ur_rect_offset_t{7, 3, 3}), + PARAMETERIZATION(copy_3D_2D, 512, 16, (ur_rect_offset_t{7, 3, 3}), (ur_rect_offset_t{1, 3, 0}), (ur_rect_region_t{1, 4, 1}), 8, 128, 2, 16); #undef PARAMETERIZATION @@ -70,12 +71,24 @@ static std::vector generateParameterizations() { struct urEnqueueMemBufferCopyRectTestWithParam : public uur::urQueueTestWithParam {}; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueMemBufferCopyRectTestWithParam, testing::ValuesIn(generateParameterizations()), uur::printRectTestString); TEST_P(urEnqueueMemBufferCopyRectTestWithParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + + const auto name = getParam().name; + if (name.find("copy_row_2D") != std::string::npos) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + } + + if (name.find("copy_3D_2D") != std::string::npos) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + } + // Unpack the parameters. const auto src_buffer_size = getParam().src_size; const auto dst_buffer_size = getParam().dst_size; @@ -232,8 +245,10 @@ TEST_P(urEnqueueMemBufferCopyRectTest, InvalidNullPtrEventWaitList) { using urEnqueueMemBufferCopyRectMultiDeviceTest = uur::urMultiDeviceMemBufferQueueTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P( + urEnqueueMemBufferCopyRectMultiDeviceTest); -TEST_F(urEnqueueMemBufferCopyRectMultiDeviceTest, CopyRectReadDifferentQueues) { +TEST_P(urEnqueueMemBufferCopyRectMultiDeviceTest, CopyRectReadDifferentQueues) { // First queue does a fill. const uint32_t input = 42; ASSERT_SUCCESS(urEnqueueMemBufferFill(queues[0], buffer, &input, @@ -272,6 +287,8 @@ TEST_F(urEnqueueMemBufferCopyRectMultiDeviceTest, CopyRectReadDifferentQueues) { } TEST_P(urEnqueueMemBufferCopyRectTest, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + // out-of-bounds access with potential overflow ur_rect_region_t src_region{size, 1, 1}; ur_rect_offset_t src_origin{std::numeric_limits::max(), 1, 1}; diff --git a/test/conformance/enqueue/urEnqueueMemBufferFill.cpp b/test/conformance/enqueue/urEnqueueMemBufferFill.cpp index 89539557fe..865caa0111 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferFill.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferFill.cpp @@ -68,10 +68,13 @@ static std::vector test_cases{ {256, 16}, {256, 32}}; -UUR_TEST_SUITE_P(urEnqueueMemBufferFillTest, testing::ValuesIn(test_cases), - uur::printFillTestString); +UUR_DEVICE_TEST_SUITE_P(urEnqueueMemBufferFillTest, + testing::ValuesIn(test_cases), + uur::printFillTestString); TEST_P(urEnqueueMemBufferFillTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEnqueueMemBufferFill(queue, buffer, pattern.data(), pattern_size, 0, size, 0, nullptr, nullptr)); @@ -81,6 +84,8 @@ TEST_P(urEnqueueMemBufferFillTest, Success) { verifyData(output, size); } TEST_P(urEnqueueMemBufferFillTest, SuccessPartialFill) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + if (size == 1) { // Can't partially fill one byte GTEST_SKIP(); @@ -106,6 +111,8 @@ TEST_P(urEnqueueMemBufferFillTest, SuccessPartialFill) { } TEST_P(urEnqueueMemBufferFillTest, SuccessOffset) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + if (size == 1) { // No room for an offset GTEST_SKIP(); @@ -196,8 +203,9 @@ TEST_P(urEnqueueMemBufferFillNegativeTest, InvalidSize) { using urEnqueueMemBufferFillMultiDeviceTest = uur::urMultiDeviceMemBufferQueueTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueMemBufferFillMultiDeviceTest); -TEST_F(urEnqueueMemBufferFillMultiDeviceTest, FillReadDifferentQueues) { +TEST_P(urEnqueueMemBufferFillMultiDeviceTest, FillReadDifferentQueues) { // First queue does a fill. const uint32_t input = 42; ASSERT_SUCCESS(urEnqueueMemBufferFill(queues[0], buffer, &input, diff --git a/test/conformance/enqueue/urEnqueueMemBufferMap.cpp b/test/conformance/enqueue/urEnqueueMemBufferMap.cpp index eb06724139..e52a849895 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferMap.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferMap.cpp @@ -4,11 +4,12 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" #include +#include using urEnqueueMemBufferMapTestWithParam = uur::urMemBufferQueueTestWithParam; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueMemBufferMapTestWithParam, ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); @@ -37,12 +38,16 @@ using urEnqueueMemBufferMapTestWithWriteFlagParam = uur::urMemBufferQueueTestWithParam< uur::mem_buffer_map_write_test_parameters_t>; -UUR_TEST_SUITE_P(urEnqueueMemBufferMapTestWithWriteFlagParam, - ::testing::ValuesIn(map_write_test_parameters), - uur::printMemBufferMapWriteTestString< - urEnqueueMemBufferMapTestWithWriteFlagParam>); +UUR_DEVICE_TEST_SUITE_P(urEnqueueMemBufferMapTestWithWriteFlagParam, + ::testing::ValuesIn(map_write_test_parameters), + uur::printMemBufferMapWriteTestString< + urEnqueueMemBufferMapTestWithWriteFlagParam>); TEST_P(urEnqueueMemBufferMapTestWithWriteFlagParam, SuccessWrite) { + if (getParam().map_flag == UR_MAP_FLAG_WRITE_INVALIDATE_REGION) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + } + const std::vector input(count, 0); ASSERT_SUCCESS(urEnqueueMemBufferWrite(queue, buffer, true, 0, size, input.data(), 0, nullptr, nullptr)); @@ -270,6 +275,8 @@ TEST_P(urEnqueueMemBufferMapTestWithParam, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemBufferMapTestWithParam, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + void *map = nullptr; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urEnqueueMemBufferMap(queue, buffer, true, 0, 1, size, 0, @@ -278,8 +285,9 @@ TEST_P(urEnqueueMemBufferMapTestWithParam, InvalidSize) { using urEnqueueMemBufferMapMultiDeviceTest = uur::urMultiDeviceMemBufferQueueTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueMemBufferMapMultiDeviceTest); -TEST_F(urEnqueueMemBufferMapMultiDeviceTest, WriteMapDifferentQueues) { +TEST_P(urEnqueueMemBufferMapMultiDeviceTest, WriteMapDifferentQueues) { // First queue does a blocking write of 42 into the buffer. std::vector input(count, 42); ASSERT_SUCCESS(urEnqueueMemBufferWrite(queues[0], buffer, true, 0, size, diff --git a/test/conformance/enqueue/urEnqueueMemBufferRead.cpp b/test/conformance/enqueue/urEnqueueMemBufferRead.cpp index 5c36ffc11c..9cb9502fbe 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferRead.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferRead.cpp @@ -4,11 +4,12 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" #include +#include using urEnqueueMemBufferReadTestWithParam = uur::urMemBufferQueueTestWithParam; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueMemBufferReadTestWithParam, ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); @@ -66,6 +67,8 @@ TEST_P(urEnqueueMemBufferReadTestWithParam, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemBufferReadTestWithParam, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + std::vector output(count, 42); ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urEnqueueMemBufferRead(queue, buffer, true, 1, size, @@ -132,8 +135,9 @@ TEST_P(urEnqueueMemBufferReadTestWithParam, NonBlocking) { using urEnqueueMemBufferReadMultiDeviceTest = uur::urMultiDeviceMemBufferQueueTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueMemBufferReadMultiDeviceTest); -TEST_F(urEnqueueMemBufferReadMultiDeviceTest, WriteReadDifferentQueues) { +TEST_P(urEnqueueMemBufferReadMultiDeviceTest, WriteReadDifferentQueues) { // First queue does a blocking write of 42 into the buffer. std::vector input(count, 42); ASSERT_SUCCESS(urEnqueueMemBufferWrite(queues[0], buffer, true, 0, size, diff --git a/test/conformance/enqueue/urEnqueueMemBufferReadRect.cpp b/test/conformance/enqueue/urEnqueueMemBufferReadRect.cpp index 549f095dfc..6d5177282b 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferReadRect.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferReadRect.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" #include +#include // Choose parameters so that we get good coverage and catch some edge cases. static std::vector generateParameterizations() { @@ -71,12 +72,15 @@ static std::vector generateParameterizations() { struct urEnqueueMemBufferReadRectTestWithParam : public uur::urQueueTestWithParam {}; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueMemBufferReadRectTestWithParam, testing::ValuesIn(generateParameterizations()), uur::printRectTestString); TEST_P(urEnqueueMemBufferReadRectTestWithParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + // Unpack the parameters. const auto buffer_size = getParam().src_size; const auto host_size = getParam().dst_size; @@ -189,8 +193,10 @@ TEST_P(urEnqueueMemBufferReadRectTest, InvalidNullPtrEventWaitList) { using urEnqueueMemBufferReadRectMultiDeviceTest = uur::urMultiDeviceMemBufferQueueTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P( + urEnqueueMemBufferReadRectMultiDeviceTest); -TEST_F(urEnqueueMemBufferReadRectMultiDeviceTest, +TEST_P(urEnqueueMemBufferReadRectMultiDeviceTest, WriteRectReadDifferentQueues) { // First queue does a blocking write of 42 into the buffer. // Then a rectangular write the buffer as 1024x1x1 1D. @@ -215,6 +221,8 @@ TEST_F(urEnqueueMemBufferReadRectMultiDeviceTest, } TEST_P(urEnqueueMemBufferReadRectTest, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + std::vector dst(count); // out-of-bounds access with potential overflow ur_rect_region_t region{size, 1, 1}; diff --git a/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp b/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp index c5ac53f14a..35079dc38b 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp @@ -4,11 +4,12 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" #include +#include using urEnqueueMemBufferWriteTestWithParam = uur::urMemBufferQueueTestWithParam; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueMemBufferWriteTestWithParam, ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); @@ -78,6 +79,8 @@ TEST_P(urEnqueueMemBufferWriteTestWithParam, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemBufferWriteTestWithParam, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + std::vector output(count, 42); ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urEnqueueMemBufferWrite(queue, buffer, true, 1, size, diff --git a/test/conformance/enqueue/urEnqueueMemBufferWriteRect.cpp b/test/conformance/enqueue/urEnqueueMemBufferWriteRect.cpp index d832fe29ed..4bbdf4acf3 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferWriteRect.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferWriteRect.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" #include +#include static std::vector generateParameterizations() { std::vector parameterizations; @@ -45,22 +46,22 @@ static std::vector generateParameterizations() { 256, 256, 256, 512); // Tests that a 8x8x8 region can be written from a 8x8x8 host buffer at // offset {0,0,0} to a 8x8x8 device buffer at offset {0,0,0}. - PARAMETERIZATION(write_3d, 512, 512, (ur_rect_offset_t{0, 0, 0}), + PARAMETERIZATION(write_3D, 512, 512, (ur_rect_offset_t{0, 0, 0}), (ur_rect_offset_t{0, 0, 0}), (ur_rect_region_t{8, 8, 8}), 8, 64, 8, 64); // Tests that a 4x3x2 region can be written from a 8x8x8 host buffer at // offset {1,2,3} to a 8x8x8 device buffer at offset {4,1,3}. - PARAMETERIZATION(write_3d_with_offsets, 512, 512, + PARAMETERIZATION(write_3D_with_offsets, 512, 512, (ur_rect_offset_t{1, 2, 3}), (ur_rect_offset_t{4, 1, 3}), (ur_rect_region_t{4, 3, 2}), 8, 64, 8, 64); // Tests that a 4x16x2 region can be written from a 8x32x1 host buffer at // offset {1,2,0} to a 8x32x4 device buffer at offset {4,1,3}. - PARAMETERIZATION(write_2d_3d, 256, 1024, (ur_rect_offset_t{1, 2, 0}), + PARAMETERIZATION(write_2D_3D, 256, 1024, (ur_rect_offset_t{1, 2, 0}), (ur_rect_offset_t{4, 1, 3}), (ur_rect_region_t{4, 16, 1}), 8, 256, 8, 256); // Tests that a 1x4x1 region can be written from a 8x16x4 host buffer at // offset {7,3,3} to a 2x8x1 device buffer at offset {1,3,0}. - PARAMETERIZATION(write_3d_2d, 512, 16, (ur_rect_offset_t{7, 3, 3}), + PARAMETERIZATION(write_3D_2D, 512, 16, (ur_rect_offset_t{7, 3, 3}), (ur_rect_offset_t{1, 3, 0}), (ur_rect_region_t{1, 4, 1}), 8, 128, 2, 16); #undef PARAMETERIZATION @@ -70,12 +71,24 @@ static std::vector generateParameterizations() { struct urEnqueueMemBufferWriteRectTestWithParam : public uur::urQueueTestWithParam {}; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueMemBufferWriteRectTestWithParam, testing::ValuesIn(generateParameterizations()), uur::printRectTestString); TEST_P(urEnqueueMemBufferWriteRectTestWithParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + + const auto name = getParam().name; + if (name.find("write_row_2D") != std::string::npos) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + } + + if (name.find("write_3D_2D") != std::string::npos) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + } + // Unpack the parameters. const auto host_size = getParam().src_size; const auto buffer_size = getParam().dst_size; @@ -195,6 +208,8 @@ TEST_P(urEnqueueMemBufferWriteRectTest, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemBufferWriteRectTest, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + std::vector src(count); std::fill(src.begin(), src.end(), 1); diff --git a/test/conformance/enqueue/urEnqueueMemImageCopy.cpp b/test/conformance/enqueue/urEnqueueMemImageCopy.cpp index 715fd66773..4b6dced608 100644 --- a/test/conformance/enqueue/urEnqueueMemImageCopy.cpp +++ b/test/conformance/enqueue/urEnqueueMemImageCopy.cpp @@ -3,6 +3,7 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urEnqueueMemImageCopyTest : public uur::urQueueTestWithParam { @@ -11,11 +12,12 @@ struct urEnqueueMemImageCopyTest uint32_t data[4]; }; void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::SetUp()); ur_bool_t imageSupported; ASSERT_SUCCESS( - urDeviceGetInfo(this->device, UR_DEVICE_INFO_IMAGE_SUPPORTED, + urDeviceGetInfo(this->device, UR_DEVICE_INFO_IMAGE_SUPPORT, sizeof(ur_bool_t), &imageSupported, nullptr)); if (!imageSupported) { GTEST_SKIP(); @@ -108,7 +110,7 @@ template inline std::string printImageCopyTestString( const testing::TestParamInfo &info) { // ParamType will be std::tuple - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); const auto image_type = std::get<1>(info.param); @@ -118,12 +120,15 @@ inline std::string printImageCopyTestString( return platform_device_name + "__" + test_name; } -UUR_TEST_SUITE_P(urEnqueueMemImageCopyTest, - testing::ValuesIn({UR_MEM_TYPE_IMAGE1D, UR_MEM_TYPE_IMAGE2D, - UR_MEM_TYPE_IMAGE3D}), - printImageCopyTestString); +UUR_DEVICE_TEST_SUITE_P(urEnqueueMemImageCopyTest, + testing::ValuesIn({UR_MEM_TYPE_IMAGE1D, + UR_MEM_TYPE_IMAGE2D, + UR_MEM_TYPE_IMAGE3D}), + printImageCopyTestString); TEST_P(urEnqueueMemImageCopyTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEnqueueMemImageCopy(queue, srcImage, dstImage, {0, 0, 0}, {0, 0, 0}, size, 0, nullptr, nullptr)); std::vector output(buffSize, {1, 1, 1, 1}); @@ -134,6 +139,8 @@ TEST_P(urEnqueueMemImageCopyTest, Success) { } TEST_P(urEnqueueMemImageCopyTest, SuccessPartialCopy) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEnqueueMemImageCopy(queue, srcImage, dstImage, {0, 0, 0}, {0, 0, 0}, partialRegion, 0, nullptr, nullptr)); @@ -158,6 +165,8 @@ TEST_P(urEnqueueMemImageCopyTest, SuccessPartialCopy) { } TEST_P(urEnqueueMemImageCopyTest, SuccessPartialCopyWithSrcOffset) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEnqueueMemImageCopy(queue, srcImage, dstImage, partialRegionOffset, {0, 0, 0}, partialRegion, 0, nullptr, nullptr)); @@ -182,6 +191,8 @@ TEST_P(urEnqueueMemImageCopyTest, SuccessPartialCopyWithSrcOffset) { } TEST_P(urEnqueueMemImageCopyTest, SuccessPartialCopyWithDstOffset) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEnqueueMemImageCopy(queue, srcImage, dstImage, {0, 0, 0}, partialRegionOffset, partialRegion, 0, nullptr, nullptr)); @@ -253,6 +264,8 @@ TEST_P(urEnqueueMemImageCopyTest, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemImageCopyTest, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urEnqueueMemImageCopy(queue, srcImage, dstImage, {1, 0, 0}, {0, 0, 0}, size, 0, nullptr, @@ -265,8 +278,9 @@ TEST_P(urEnqueueMemImageCopyTest, InvalidSize) { using urEnqueueMemImageCopyMultiDeviceTest = uur::urMultiDeviceMemImageWriteTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueMemImageCopyMultiDeviceTest); -TEST_F(urEnqueueMemImageCopyMultiDeviceTest, CopyReadDifferentQueues) { +TEST_P(urEnqueueMemImageCopyMultiDeviceTest, CopyReadDifferentQueues) { ur_mem_handle_t dstImage1D = nullptr; ASSERT_SUCCESS(urMemImageCreate(context, UR_MEM_FLAG_READ_WRITE, &format, &desc1D, nullptr, &dstImage1D)); diff --git a/test/conformance/enqueue/urEnqueueMemImageRead.cpp b/test/conformance/enqueue/urEnqueueMemImageRead.cpp index af65d6feab..ad0c4b1afa 100644 --- a/test/conformance/enqueue/urEnqueueMemImageRead.cpp +++ b/test/conformance/enqueue/urEnqueueMemImageRead.cpp @@ -3,8 +3,14 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include -using urEnqueueMemImageReadTest = uur::urMemImageQueueTest; +struct urEnqueueMemImageReadTest : uur::urMemImageQueueTest { + void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urMemImageQueueTest::SetUp()); + } +}; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueMemImageReadTest); // Note that for each test, we multiply the size in pixels by 4 to account for @@ -80,6 +86,8 @@ TEST_P(urEnqueueMemImageReadTest, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemImageReadTest, InvalidOrigin1D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector output(width * 4, 42); ur_rect_offset_t bad_origin{1, 0, 0}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -89,6 +97,8 @@ TEST_P(urEnqueueMemImageReadTest, InvalidOrigin1D) { } TEST_P(urEnqueueMemImageReadTest, InvalidOrigin2D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector output(width * height * 4, 42); ur_rect_offset_t bad_origin{0, 1, 0}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -98,6 +108,8 @@ TEST_P(urEnqueueMemImageReadTest, InvalidOrigin2D) { } TEST_P(urEnqueueMemImageReadTest, InvalidOrigin3D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector output(width * height * depth * 4, 42); ur_rect_offset_t bad_origin{0, 0, 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -107,6 +119,8 @@ TEST_P(urEnqueueMemImageReadTest, InvalidOrigin3D) { } TEST_P(urEnqueueMemImageReadTest, InvalidRegion1D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector output(width * 4, 42); ur_rect_region_t bad_region{width + 1, 1, 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -116,6 +130,8 @@ TEST_P(urEnqueueMemImageReadTest, InvalidRegion1D) { } TEST_P(urEnqueueMemImageReadTest, InvalidRegion2D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector output(width * height * 4, 42); ur_rect_region_t bad_region{width, height + 1, 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -125,6 +141,8 @@ TEST_P(urEnqueueMemImageReadTest, InvalidRegion2D) { } TEST_P(urEnqueueMemImageReadTest, InvalidRegion3D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector output(width * height * depth * 4, 42); ur_rect_region_t bad_region{width, height, depth + 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -135,8 +153,9 @@ TEST_P(urEnqueueMemImageReadTest, InvalidRegion3D) { using urEnqueueMemImageReadMultiDeviceTest = uur::urMultiDeviceMemImageWriteTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueMemImageReadMultiDeviceTest); -TEST_F(urEnqueueMemImageReadMultiDeviceTest, WriteReadDifferentQueues) { +TEST_P(urEnqueueMemImageReadMultiDeviceTest, WriteReadDifferentQueues) { // The remaining queues do blocking reads from the image1D/2D/3D. Since the // queues target different devices this checks that any devices memory has // been synchronized. diff --git a/test/conformance/enqueue/urEnqueueMemImageWrite.cpp b/test/conformance/enqueue/urEnqueueMemImageWrite.cpp index ab8a652d4b..936b0494d1 100644 --- a/test/conformance/enqueue/urEnqueueMemImageWrite.cpp +++ b/test/conformance/enqueue/urEnqueueMemImageWrite.cpp @@ -3,8 +3,14 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include - -using urEnqueueMemImageWriteTest = uur::urMemImageQueueTest; +#include + +struct urEnqueueMemImageWriteTest : uur::urMemImageQueueTest { + void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urMemImageQueueTest::SetUp()); + } +}; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueMemImageWriteTest); TEST_P(urEnqueueMemImageWriteTest, Success1D) { @@ -77,6 +83,8 @@ TEST_P(urEnqueueMemImageWriteTest, InvalidNullPtrEventWaitList) { } TEST_P(urEnqueueMemImageWriteTest, InvalidOrigin1D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector input(width * 4, 42); ur_rect_offset_t bad_origin{1, 0, 0}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -86,6 +94,8 @@ TEST_P(urEnqueueMemImageWriteTest, InvalidOrigin1D) { } TEST_P(urEnqueueMemImageWriteTest, InvalidOrigin2D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector input(width * height * 4, 42); ur_rect_offset_t bad_origin{0, 1, 0}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -95,6 +105,8 @@ TEST_P(urEnqueueMemImageWriteTest, InvalidOrigin2D) { } TEST_P(urEnqueueMemImageWriteTest, InvalidOrigin3D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector input(width * height * depth * 4, 42); ur_rect_offset_t bad_origin{0, 0, 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -104,6 +116,8 @@ TEST_P(urEnqueueMemImageWriteTest, InvalidOrigin3D) { } TEST_P(urEnqueueMemImageWriteTest, InvalidRegion1D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector input(width * 4, 42); ur_rect_region_t bad_region{width + 1, 1, 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -113,6 +127,8 @@ TEST_P(urEnqueueMemImageWriteTest, InvalidRegion1D) { } TEST_P(urEnqueueMemImageWriteTest, InvalidRegion2D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector input(width * height * 4, 42); ur_rect_region_t bad_region{width, height + 1, 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, @@ -122,6 +138,8 @@ TEST_P(urEnqueueMemImageWriteTest, InvalidRegion2D) { } TEST_P(urEnqueueMemImageWriteTest, InvalidRegion3D) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + std::vector input(width * height * depth * 4, 42); ur_rect_region_t bad_region{width, height, depth + 1}; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, diff --git a/test/conformance/enqueue/urEnqueueMemUnmap.cpp b/test/conformance/enqueue/urEnqueueMemUnmap.cpp index 41b604abeb..776d328e85 100644 --- a/test/conformance/enqueue/urEnqueueMemUnmap.cpp +++ b/test/conformance/enqueue/urEnqueueMemUnmap.cpp @@ -24,9 +24,10 @@ struct urEnqueueMemUnmapTestWithParam uint32_t *map = nullptr; }; -UUR_TEST_SUITE_P(urEnqueueMemUnmapTestWithParam, - ::testing::ValuesIn(uur::mem_buffer_test_parameters), - uur::printMemBufferTestString); +UUR_DEVICE_TEST_SUITE_P( + urEnqueueMemUnmapTestWithParam, + ::testing::ValuesIn(uur::mem_buffer_test_parameters), + uur::printMemBufferTestString); TEST_P(urEnqueueMemUnmapTestWithParam, Success) { ASSERT_SUCCESS(urEnqueueMemUnmap(queue, buffer, map, 0, nullptr, nullptr)); diff --git a/test/conformance/enqueue/urEnqueueTimestampRecording.cpp b/test/conformance/enqueue/urEnqueueTimestampRecording.cpp index d3a97e3b48..e4d944d904 100644 --- a/test/conformance/enqueue/urEnqueueTimestampRecording.cpp +++ b/test/conformance/enqueue/urEnqueueTimestampRecording.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urEnqueueTimestampRecordingExpTest : uur::urQueueTest { void SetUp() override { @@ -45,6 +46,9 @@ void common_check(ur_event_handle_t event) { } TEST_P(urEnqueueTimestampRecordingExpTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + ur_event_handle_t event = nullptr; ASSERT_SUCCESS( urEnqueueTimestampRecordingExp(queue, false, 0, nullptr, &event)); @@ -54,6 +58,10 @@ TEST_P(urEnqueueTimestampRecordingExpTest, Success) { } TEST_P(urEnqueueTimestampRecordingExpTest, SuccessBlocking) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + ur_event_handle_t event = nullptr; ASSERT_SUCCESS( urEnqueueTimestampRecordingExp(queue, true, 0, nullptr, &event)); diff --git a/test/conformance/enqueue/urEnqueueUSMAdvise.cpp b/test/conformance/enqueue/urEnqueueUSMAdvise.cpp index 10a1e03670..28811a414d 100644 --- a/test/conformance/enqueue/urEnqueueUSMAdvise.cpp +++ b/test/conformance/enqueue/urEnqueueUSMAdvise.cpp @@ -4,14 +4,22 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urEnqueueUSMAdviseWithParamTest = uur::urUSMDeviceAllocTestWithParam; -UUR_TEST_SUITE_P(urEnqueueUSMAdviseWithParamTest, - ::testing::Values(UR_USM_ADVICE_FLAG_DEFAULT), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urEnqueueUSMAdviseWithParamTest, + ::testing::Values(UR_USM_ADVICE_FLAG_DEFAULT), + uur::deviceTestWithParamPrinter); TEST_P(urEnqueueUSMAdviseWithParamTest, Success) { + // HIP and CUDA return UR_RESULT_ERROR_ADAPTER_SPECIFIC to issue a warning + // about the hint being unsupported. + // TODO: codify this in the spec and account for it in the CTS. + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_event_handle_t advise_event = nullptr; ASSERT_SUCCESS(urEnqueueUSMAdvise(queue, ptr, allocation_size, getParam(), &advise_event)); @@ -32,6 +40,12 @@ using urEnqueueUSMAdviseTest = uur::urUSMDeviceAllocTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueUSMAdviseTest); TEST_P(urEnqueueUSMAdviseTest, MultipleParamsSuccess) { + // HIP and CUDA return UR_RESULT_ERROR_ADAPTER_SPECIFIC to issue a warning + // about the hint being unsupported. + // TODO: codify this in the spec and account for it in the CTS. + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + ASSERT_SUCCESS(urEnqueueUSMAdvise(queue, ptr, allocation_size, UR_USM_ADVICE_FLAG_SET_READ_MOSTLY | UR_USM_ADVICE_FLAG_BIAS_CACHED, @@ -64,6 +78,10 @@ TEST_P(urEnqueueUSMAdviseTest, InvalidSizeZero) { } TEST_P(urEnqueueUSMAdviseTest, InvalidSizeTooLarge) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urEnqueueUSMAdvise(queue, ptr, allocation_size * 2, UR_USM_ADVICE_FLAG_DEFAULT, nullptr)); diff --git a/test/conformance/enqueue/urEnqueueUSMFill.cpp b/test/conformance/enqueue/urEnqueueUSMFill.cpp index 815c5bd2a5..320586b2ad 100644 --- a/test/conformance/enqueue/urEnqueueUSMFill.cpp +++ b/test/conformance/enqueue/urEnqueueUSMFill.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct testParametersFill { size_t size; @@ -13,7 +14,7 @@ struct testParametersFill { template inline std::string printFillTestString(const testing::TestParamInfo &info) { - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; @@ -90,10 +91,12 @@ static std::vector test_cases{ {256, 16}, {256, 32}}; -UUR_TEST_SUITE_P(urEnqueueUSMFillTestWithParam, testing::ValuesIn(test_cases), - printFillTestString); +UUR_DEVICE_TEST_SUITE_P(urEnqueueUSMFillTestWithParam, + testing::ValuesIn(test_cases), + printFillTestString); TEST_P(urEnqueueUSMFillTestWithParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); ur_event_handle_t event = nullptr; diff --git a/test/conformance/enqueue/urEnqueueUSMFill2D.cpp b/test/conformance/enqueue/urEnqueueUSMFill2D.cpp index e5d3186b81..db128781eb 100644 --- a/test/conformance/enqueue/urEnqueueUSMFill2D.cpp +++ b/test/conformance/enqueue/urEnqueueUSMFill2D.cpp @@ -4,7 +4,9 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include +#include struct testParametersFill2D { size_t pitch; @@ -16,7 +18,7 @@ struct testParametersFill2D { template inline std::string printFill2DTestString( const testing::TestParamInfo &info) { - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; @@ -127,8 +129,9 @@ static std::vector test_cases{ /* Height != power_of_2 && width == power_of_2 && pattern_size == 128 */ {1024, 256, 35, 128}}; -UUR_TEST_SUITE_P(urEnqueueUSMFill2DTestWithParam, testing::ValuesIn(test_cases), - printFill2DTestString); +UUR_DEVICE_TEST_SUITE_P(urEnqueueUSMFill2DTestWithParam, + testing::ValuesIn(test_cases), + printFill2DTestString); TEST_P(urEnqueueUSMFill2DTestWithParam, Success) { @@ -243,6 +246,10 @@ TEST_P(urEnqueueUSMFill2DNegativeTest, InvalidSize) { } TEST_P(urEnqueueUSMFill2DNegativeTest, OutOfBounds) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t out_of_bounds = pitch * height + 1; /* Interpret memory as having just one row */ diff --git a/test/conformance/enqueue/urEnqueueUSMMemcpy.cpp b/test/conformance/enqueue/urEnqueueUSMMemcpy.cpp index 9189eaea4d..709737476f 100644 --- a/test/conformance/enqueue/urEnqueueUSMMemcpy.cpp +++ b/test/conformance/enqueue/urEnqueueUSMMemcpy.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include #include struct urEnqueueUSMMemcpyTest : uur::urQueueTest { @@ -87,6 +88,8 @@ TEST_P(urEnqueueUSMMemcpyTest, Blocking) { * UR_EVENT_STATUS_COMPLETE when the blocking parameter is set to true. */ TEST_P(urEnqueueUSMMemcpyTest, BlockingWithEvent) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_event_handle_t memcpy_event = nullptr; ASSERT_SUCCESS(urEventWait(1, &memset_event)); ASSERT_TRUE(memsetHasFinished()); @@ -125,6 +128,8 @@ TEST_P(urEnqueueUSMMemcpyTest, NonBlocking) { * the memory. */ TEST_P(urEnqueueUSMMemcpyTest, WaitForDependencies) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS(urEnqueueUSMMemcpy(queue, true, device_dst, device_src, allocation_size, 1, &memset_event, nullptr)); @@ -244,8 +249,9 @@ struct urEnqueueUSMMemcpyMultiDeviceTest : uur::urAllDevicesTest { size_t alloc_size = 64; uint8_t fill_pattern = 42; }; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urEnqueueUSMMemcpyMultiDeviceTest); -TEST_F(urEnqueueUSMMemcpyMultiDeviceTest, DeviceToDeviceCopyBlocking) { +TEST_P(urEnqueueUSMMemcpyMultiDeviceTest, DeviceToDeviceCopyBlocking) { ASSERT_SUCCESS(urEnqueueUSMMemcpy(src_queue, true, dst_alloc, src_alloc, alloc_size, 0, nullptr, nullptr)); ASSERT_SUCCESS(urEnqueueUSMMemcpy(dst_queue, true, host_alloc, dst_alloc, @@ -253,7 +259,7 @@ TEST_F(urEnqueueUSMMemcpyMultiDeviceTest, DeviceToDeviceCopyBlocking) { verifyData(); } -TEST_F(urEnqueueUSMMemcpyMultiDeviceTest, DeviceToDeviceCopyNonBlocking) { +TEST_P(urEnqueueUSMMemcpyMultiDeviceTest, DeviceToDeviceCopyNonBlocking) { ur_event_handle_t device_copy_event = nullptr; ASSERT_SUCCESS(urEnqueueUSMMemcpy(src_queue, false, dst_alloc, src_alloc, alloc_size, 0, nullptr, diff --git a/test/conformance/enqueue/urEnqueueUSMMemcpy2D.cpp b/test/conformance/enqueue/urEnqueueUSMMemcpy2D.cpp index e12e79a295..edb8f4c1b1 100644 --- a/test/conformance/enqueue/urEnqueueUSMMemcpy2D.cpp +++ b/test/conformance/enqueue/urEnqueueUSMMemcpy2D.cpp @@ -4,7 +4,9 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "helpers.h" + #include +#include using TestParametersMemcpy2D = std::tuple; @@ -12,6 +14,8 @@ using TestParametersMemcpy2D = struct urEnqueueUSMMemcpy2DTestWithParam : uur::urQueueTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE( uur::urQueueTestWithParam::SetUp()); @@ -108,7 +112,7 @@ static std::vector test_sizes{ /* Height == 1 && Pitch == width + 1 */ {234, 233, 1}}; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urEnqueueUSMMemcpy2DTestWithParam, ::testing::Combine(::testing::ValuesIn(test_sizes), ::testing::Values(ur_usm_type_t::UR_USM_TYPE_DEVICE, @@ -142,12 +146,13 @@ TEST_P(urEnqueueUSMMemcpy2DTestWithParam, SuccessNonBlocking) { } using urEnqueueUSMMemcpy2DNegativeTest = urEnqueueUSMMemcpy2DTestWithParam; -UUR_TEST_SUITE_P(urEnqueueUSMMemcpy2DNegativeTest, - ::testing::Values(TestParametersMemcpy2D{ - {1, 1, 1}, - ur_usm_type_t::UR_USM_TYPE_DEVICE, - ur_usm_type_t::UR_USM_TYPE_DEVICE}), - uur::print2DTestString); +UUR_DEVICE_TEST_SUITE_P( + urEnqueueUSMMemcpy2DNegativeTest, + ::testing::Values(TestParametersMemcpy2D{ + {1, 1, 1}, + ur_usm_type_t::UR_USM_TYPE_DEVICE, + ur_usm_type_t::UR_USM_TYPE_DEVICE}), + uur::print2DTestString); TEST_P(urEnqueueUSMMemcpy2DNegativeTest, InvalidNullHandleQueue) { ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, diff --git a/test/conformance/enqueue/urEnqueueUSMPrefetch.cpp b/test/conformance/enqueue/urEnqueueUSMPrefetch.cpp index 2b0dbacb74..af7e6aad4e 100644 --- a/test/conformance/enqueue/urEnqueueUSMPrefetch.cpp +++ b/test/conformance/enqueue/urEnqueueUSMPrefetch.cpp @@ -4,15 +4,24 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urEnqueueUSMPrefetchWithParamTest = uur::urUSMDeviceAllocTestWithParam; -UUR_TEST_SUITE_P(urEnqueueUSMPrefetchWithParamTest, - ::testing::Values(UR_USM_MIGRATION_FLAG_DEFAULT), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urEnqueueUSMPrefetchWithParamTest, + ::testing::Values(UR_USM_MIGRATION_FLAG_DEFAULT), + uur::deviceTestWithParamPrinter); TEST_P(urEnqueueUSMPrefetchWithParamTest, Success) { + // HIP and CUDA return UR_RESULT_ERROR_ADAPTER_SPECIFIC to issue a warning + // about the hint being unsupported. + // TODO: codify this in the spec and account for it in the CTS. + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_event_handle_t prefetch_event = nullptr; ASSERT_SUCCESS(urEnqueueUSMPrefetch(queue, ptr, allocation_size, getParam(), 0, nullptr, &prefetch_event)); @@ -32,6 +41,12 @@ TEST_P(urEnqueueUSMPrefetchWithParamTest, Success) { * executing. */ TEST_P(urEnqueueUSMPrefetchWithParamTest, CheckWaitEvent) { + // HIP and CUDA return UR_RESULT_ERROR_ADAPTER_SPECIFIC to issue a warning + // about the hint being unsupported. + // TODO: codify this in the spec and account for it in the CTS. + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); ur_queue_handle_t fill_queue; ASSERT_SUCCESS(urQueueCreate(context, device, nullptr, &fill_queue)); @@ -103,6 +118,10 @@ TEST_P(urEnqueueUSMPrefetchTest, InvalidSizeZero) { } TEST_P(urEnqueueUSMPrefetchTest, InvalidSizeTooLarge) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urEnqueueUSMPrefetch(queue, ptr, allocation_size * 2, UR_USM_MIGRATION_FLAG_DEFAULT, 0, diff --git a/test/conformance/event/event_adapter_cuda.match b/test/conformance/event/event_adapter_cuda.match deleted file mode 100644 index daa3c281bc..0000000000 --- a/test/conformance/event/event_adapter_cuda.match +++ /dev/null @@ -1,6 +0,0 @@ -urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_COMPLETE -urEventGetProfilingInfoWithTimingComparisonTest.Success/* -urEventSetCallbackTest.Success/* -urEventSetCallbackTest.ValidateParameters/* -urEventSetCallbackTest.AllStates/* -urEventSetCallbackTest.EventAlreadyCompleted/* diff --git a/test/conformance/event/event_adapter_hip.match b/test/conformance/event/event_adapter_hip.match deleted file mode 100644 index daa3c281bc..0000000000 --- a/test/conformance/event/event_adapter_hip.match +++ /dev/null @@ -1,6 +0,0 @@ -urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_COMPLETE -urEventGetProfilingInfoWithTimingComparisonTest.Success/* -urEventSetCallbackTest.Success/* -urEventSetCallbackTest.ValidateParameters/* -urEventSetCallbackTest.AllStates/* -urEventSetCallbackTest.EventAlreadyCompleted/* diff --git a/test/conformance/event/event_adapter_level_zero.match b/test/conformance/event/event_adapter_level_zero.match deleted file mode 100644 index e7fe14c234..0000000000 --- a/test/conformance/event/event_adapter_level_zero.match +++ /dev/null @@ -1,10 +0,0 @@ -{{OPT}}urEventGetInfoTest.Success/*__UR_EVENT_INFO_COMMAND_TYPE -{{OPT}}urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_QUEUED -{{OPT}}urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_SUBMIT -{{OPT}}urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_COMPLETE -{{OPT}}urEventGetProfilingInfoWithTimingComparisonTest.Success/* -urEventCreateWithNativeHandleTest.Success/* -urEventSetCallbackTest.AllStates/* -urEventSetCallbackTest.EventAlreadyCompleted/* -urEventSetCallbackTest.Success/* -urEventSetCallbackTest.ValidateParameters/* diff --git a/test/conformance/event/event_adapter_level_zero_v2.match b/test/conformance/event/event_adapter_level_zero_v2.match deleted file mode 100644 index dd70962041..0000000000 --- a/test/conformance/event/event_adapter_level_zero_v2.match +++ /dev/null @@ -1,7 +0,0 @@ -urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_QUEUED -urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_SUBMIT -urEventGetProfilingInfoWithTimingComparisonTest.Success/* -urEventSetCallbackTest.Success/* -urEventSetCallbackTest.ValidateParameters/* -urEventSetCallbackTest.AllStates/* -urEventSetCallbackTest.EventAlreadyCompleted/* diff --git a/test/conformance/event/event_adapter_native_cpu.match b/test/conformance/event/event_adapter_native_cpu.match deleted file mode 100644 index 1716dea0ca..0000000000 --- a/test/conformance/event/event_adapter_native_cpu.match +++ /dev/null @@ -1,17 +0,0 @@ -urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_QUEUED -urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_SUBMIT -urEventGetProfilingInfoTest.Success/*__UR_PROFILING_INFO_COMMAND_COMPLETE -urEventGetProfilingInfoWithTimingComparisonTest.Success/* -urEventGetProfilingInfoNegativeTest.InvalidNullHandle/* -urEventGetProfilingInfoNegativeTest.InvalidValue/* -urEventWaitTest.Success/* -urEventSetCallbackTest.Success/* -urEventSetCallbackTest.ValidateParameters/* -urEventSetCallbackTest.AllStates/* -urEventSetCallbackTest.EventAlreadyCompleted/* - -# These crash when ran through the loader -{{OPT}}urEventRetainTest.InvalidNullHandle/* -{{OPT}}urEventReleaseTest.InvalidNullHandle/* -{{OPT}}urEventGetNativeHandleTest.InvalidNullHandleEvent/* -{{OPT}}urEventSetCallbackNegativeTest.InvalidNullHandleEvent/* diff --git a/test/conformance/event/event_adapter_opencl.match b/test/conformance/event/event_adapter_opencl.match deleted file mode 100644 index 2c65414d2d..0000000000 --- a/test/conformance/event/event_adapter_opencl.match +++ /dev/null @@ -1,3 +0,0 @@ -# Note: This file is only for use with cts_exe.py, not the legacy match checker -# These crash when ran through the loader -{{OPT}}urEventSetCallbackTest.ValidateParameters/* diff --git a/test/conformance/event/urEventCreateWithNativeHandle.cpp b/test/conformance/event/urEventCreateWithNativeHandle.cpp index bfb7113053..75e52f9a07 100644 --- a/test/conformance/event/urEventCreateWithNativeHandle.cpp +++ b/test/conformance/event/urEventCreateWithNativeHandle.cpp @@ -4,12 +4,15 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "fixtures.h" +#include "uur/known_failure.h" #include "uur/raii.h" using urEventCreateWithNativeHandleTest = uur::event::urEventTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEventCreateWithNativeHandleTest); TEST_P(urEventCreateWithNativeHandleTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ur_native_handle_t native_event = 0; UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( diff --git a/test/conformance/event/urEventGetInfo.cpp b/test/conformance/event/urEventGetInfo.cpp index d2ff63657b..90c6e6c1df 100644 --- a/test/conformance/event/urEventGetInfo.cpp +++ b/test/conformance/event/urEventGetInfo.cpp @@ -4,12 +4,17 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "fixtures.h" +#include "uur/known_failure.h" using urEventGetInfoTest = uur::event::urEventTestWithParam; TEST_P(urEventGetInfoTest, Success) { - ur_event_info_t info_type = getParam(); + + if (info_type == UR_EVENT_INFO_COMMAND_TYPE) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + } + size_t size; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( urEventGetInfo(event, info_type, 0, nullptr, &size), info_type); @@ -58,13 +63,13 @@ TEST_P(urEventGetInfoTest, Success) { } } -UUR_TEST_SUITE_P(urEventGetInfoTest, - ::testing::Values(UR_EVENT_INFO_COMMAND_QUEUE, - UR_EVENT_INFO_CONTEXT, - UR_EVENT_INFO_COMMAND_TYPE, - UR_EVENT_INFO_COMMAND_EXECUTION_STATUS, - UR_EVENT_INFO_REFERENCE_COUNT), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urEventGetInfoTest, + ::testing::Values(UR_EVENT_INFO_COMMAND_QUEUE, UR_EVENT_INFO_CONTEXT, + UR_EVENT_INFO_COMMAND_TYPE, + UR_EVENT_INFO_COMMAND_EXECUTION_STATUS, + UR_EVENT_INFO_REFERENCE_COUNT), + uur::deviceTestWithParamPrinter); using urEventGetInfoNegativeTest = uur::event::urEventTest; diff --git a/test/conformance/event/urEventGetNativeHandle.cpp b/test/conformance/event/urEventGetNativeHandle.cpp index 0707caaaad..0dca6c005b 100644 --- a/test/conformance/event/urEventGetNativeHandle.cpp +++ b/test/conformance/event/urEventGetNativeHandle.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "fixtures.h" +#include "uur/known_failure.h" using urEventGetNativeHandleTest = uur::event::urEventTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEventGetNativeHandleTest); @@ -16,6 +17,9 @@ TEST_P(urEventGetNativeHandleTest, Success) { } TEST_P(urEventGetNativeHandleTest, InvalidNullHandleEvent) { + // This test has issues when UR_CONFORMANCE_TEST_LOADER=ON + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_native_handle_t native_event = 0; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, urEventGetNativeHandle(nullptr, &native_event)); diff --git a/test/conformance/event/urEventGetProfilingInfo.cpp b/test/conformance/event/urEventGetProfilingInfo.cpp index 73e3db2d18..08d8cea495 100644 --- a/test/conformance/event/urEventGetProfilingInfo.cpp +++ b/test/conformance/event/urEventGetProfilingInfo.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "fixtures.h" +#include "uur/known_failure.h" using urEventGetProfilingInfoTest = uur::event::urEventTestWithParam; @@ -11,6 +12,26 @@ using urEventGetProfilingInfoTest = TEST_P(urEventGetProfilingInfoTest, Success) { ur_profiling_info_t info_type = getParam(); + + if (info_type == UR_PROFILING_INFO_COMMAND_COMPLETE) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + } + + if (info_type == UR_PROFILING_INFO_COMMAND_QUEUED) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + } + + if (info_type == UR_PROFILING_INFO_COMMAND_SUBMIT) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + } + size_t size; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( urEventGetProfilingInfo(event, info_type, 0, nullptr, &size), @@ -27,17 +48,23 @@ TEST_P(urEventGetProfilingInfoTest, Success) { } } -UUR_TEST_SUITE_P(urEventGetProfilingInfoTest, - ::testing::Values(UR_PROFILING_INFO_COMMAND_QUEUED, - UR_PROFILING_INFO_COMMAND_SUBMIT, - UR_PROFILING_INFO_COMMAND_START, - UR_PROFILING_INFO_COMMAND_END, - UR_PROFILING_INFO_COMMAND_COMPLETE), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urEventGetProfilingInfoTest, + ::testing::Values(UR_PROFILING_INFO_COMMAND_QUEUED, + UR_PROFILING_INFO_COMMAND_SUBMIT, + UR_PROFILING_INFO_COMMAND_START, + UR_PROFILING_INFO_COMMAND_END, + UR_PROFILING_INFO_COMMAND_COMPLETE), + uur::deviceTestWithParamPrinter); using urEventGetProfilingInfoWithTimingComparisonTest = uur::event::urEventTest; TEST_P(urEventGetProfilingInfoWithTimingComparisonTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + uint8_t size = 8; std::vector queued_data(size); @@ -86,6 +113,8 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P( using urEventGetProfilingInfoNegativeTest = uur::event::urEventTest; TEST_P(urEventGetProfilingInfoNegativeTest, InvalidNullHandle) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_profiling_info_t info_type = UR_PROFILING_INFO_COMMAND_QUEUED; size_t size; ASSERT_SUCCESS( @@ -108,6 +137,8 @@ TEST_P(urEventGetProfilingInfoNegativeTest, InvalidEnumeration) { } TEST_P(urEventGetProfilingInfoNegativeTest, InvalidValue) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_profiling_info_t info_type = UR_PROFILING_INFO_COMMAND_QUEUED; size_t size; ASSERT_SUCCESS( diff --git a/test/conformance/event/urEventRelease.cpp b/test/conformance/event/urEventRelease.cpp index d74241b2e0..c77ef7fdc5 100644 --- a/test/conformance/event/urEventRelease.cpp +++ b/test/conformance/event/urEventRelease.cpp @@ -4,12 +4,16 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "fixtures.h" +#include "uur/known_failure.h" using urEventReleaseTest = uur::event::urEventTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEventReleaseTest); TEST_P(urEventReleaseTest, Success) { + // This test has issues when UR_CONFORMANCE_TEST_LOADER=ON + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_SUCCESS(urEventRetain(event)); uint32_t prevRefCount = 0; diff --git a/test/conformance/event/urEventRetain.cpp b/test/conformance/event/urEventRetain.cpp index 1e63f6d907..507977d9e6 100644 --- a/test/conformance/event/urEventRetain.cpp +++ b/test/conformance/event/urEventRetain.cpp @@ -4,11 +4,15 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "fixtures.h" +#include "uur/known_failure.h" using urEventRetainTest = uur::event::urEventTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEventRetainTest); TEST_P(urEventRetainTest, Success) { + // This test has issues when UR_CONFORMANCE_TEST_LOADER=ON + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + uint32_t prevRefCount = 0; ASSERT_SUCCESS(uur::GetObjectReferenceCount(event, prevRefCount)); diff --git a/test/conformance/event/urEventSetCallback.cpp b/test/conformance/event/urEventSetCallback.cpp index ac6f988e71..7f16687b10 100644 --- a/test/conformance/event/urEventSetCallback.cpp +++ b/test/conformance/event/urEventSetCallback.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "fixtures.h" +#include "uur/known_failure.h" /* Using urEventReferenceTest to be able to release the event during the test */ using urEventSetCallbackTest = uur::event::urEventReferenceTest; @@ -12,6 +13,11 @@ using urEventSetCallbackTest = uur::event::urEventReferenceTest; * Checks that the callback function is called. */ TEST_P(urEventSetCallbackTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); struct Callback { static void callback([[maybe_unused]] ur_event_handle_t hEvent, @@ -37,6 +43,14 @@ TEST_P(urEventSetCallbackTest, Success) { * Check that the callback function parameters are correct */ TEST_P(urEventSetCallbackTest, ValidateParameters) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + // This test has issues when UR_CONFORMANCE_TEST_LOADER=ON + UUR_KNOWN_FAILURE_ON(uur::OpenCL{}); struct CallbackParameters { ur_event_handle_t event; @@ -70,6 +84,11 @@ TEST_P(urEventSetCallbackTest, ValidateParameters) { * Check that the callback function is called for each execution state. */ TEST_P(urEventSetCallbackTest, AllStates) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); struct CallbackStatus { bool submitted = false; @@ -127,6 +146,11 @@ TEST_P(urEventSetCallbackTest, AllStates) { * completed */ TEST_P(urEventSetCallbackTest, EventAlreadyCompleted) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); ASSERT_SUCCESS(urEventWait(1, &event)); @@ -158,6 +182,9 @@ using urEventSetCallbackNegativeTest = uur::event::urEventTest; void emptyCallback(ur_event_handle_t, ur_execution_info_t, void *) {} TEST_P(urEventSetCallbackNegativeTest, InvalidNullHandleEvent) { + // This test has issues when UR_CONFORMANCE_TEST_LOADER=ON + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_EQ_RESULT(urEventSetCallback( nullptr, ur_execution_info_t::UR_EXECUTION_INFO_QUEUED, emptyCallback, nullptr), diff --git a/test/conformance/event/urEventWait.cpp b/test/conformance/event/urEventWait.cpp index 1fbfaa09c3..a89d8b76b9 100644 --- a/test/conformance/event/urEventWait.cpp +++ b/test/conformance/event/urEventWait.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urEventWaitTest : uur::urQueueTest { void SetUp() override { @@ -42,6 +43,8 @@ struct urEventWaitTest : uur::urQueueTest { UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEventWaitTest); TEST_P(urEventWaitTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_event_handle_t event1 = nullptr; ASSERT_SUCCESS(urEnqueueMemBufferCopy(queue, src_buffer, dst_buffer, 0, 0, size, 0, nullptr, &event1)); diff --git a/test/conformance/exp_command_buffer/exp_command_buffer_adapter_level_zero_v2.match b/test/conformance/exp_command_buffer/exp_command_buffer_adapter_level_zero_v2.match deleted file mode 100644 index f6efce7966..0000000000 --- a/test/conformance/exp_command_buffer/exp_command_buffer_adapter_level_zero_v2.match +++ /dev/null @@ -1,51 +0,0 @@ -urCommandBufferReleaseExpTest.Success/* -urCommandBufferReleaseExpTest.InvalidNullHandle/* -urCommandBufferRetainExpTest.Success/* -urCommandBufferRetainExpTest.InvalidNullHandle/* -urCommandBufferCommandsTest.urCommandBufferAppendUSMMemcpyExp/* -urCommandBufferCommandsTest.urCommandBufferAppendUSMFillExp/* -urCommandBufferCommandsTest.urCommandBufferAppendMemBufferCopyExp/* -urCommandBufferCommandsTest.urCommandBufferAppendMemBufferCopyRectExp/* -urCommandBufferCommandsTest.urCommandBufferAppendMemBufferReadExp/* -urCommandBufferCommandsTest.urCommandBufferAppendMemBufferReadRectExp/* -urCommandBufferCommandsTest.urCommandBufferAppendMemBufferWriteExp/* -urCommandBufferCommandsTest.urCommandBufferAppendMemBufferWriteRectExp/* -urCommandBufferCommandsTest.urCommandBufferAppendMemBufferFillExp/* -urCommandBufferCommandsTest.urCommandBufferAppendUSMPrefetchExp/* -urCommandBufferCommandsTest.urCommandBufferAppendUSMAdviseExp/* -urCommandBufferAppendKernelLaunchExpTest.Basic/* -urCommandBufferAppendKernelLaunchExpTest.FinalizeTwice/* -urCommandBufferFillCommandsTest.Buffer/* -urCommandBufferFillCommandsTest.USM/* -KernelCommandEventSyncTest.Basic/* -KernelCommandEventSyncTest.InterCommandBuffer/* -KernelCommandEventSyncTest.SignalWaitBeforeEnqueue/* -CommandEventSyncTest.USMMemcpyExp/* -CommandEventSyncTest.USMFillExp/* -CommandEventSyncTest.MemBufferCopyExp/* -CommandEventSyncTest.MemBufferCopyRectExp/* -CommandEventSyncTest.MemBufferReadExp/* -CommandEventSyncTest.MemBufferReadRectExp/* -CommandEventSyncTest.MemBufferWriteExp/* -CommandEventSyncTest.MemBufferWriteRectExp/* -CommandEventSyncTest.MemBufferFillExp/* -CommandEventSyncTest.USMPrefetchExp/* -CommandEventSyncTest.USMAdviseExp/* -CommandEventSyncTest.MultipleEventCommands/* -CommandEventSyncTest.MultipleEventCommandsBetweenCommandBuffers/* -CommandEventSyncTest.USMFillLargePatternExp/* -CommandEventSyncTest.MemBufferFillLargePatternExp/* -CommandEventSyncUpdateTest.USMMemcpyExp/* -CommandEventSyncUpdateTest.USMFillExp/* -CommandEventSyncUpdateTest.MemBufferCopyExp/* -CommandEventSyncUpdateTest.MemBufferCopyRectExp/* -CommandEventSyncUpdateTest.MemBufferReadExp/* -CommandEventSyncUpdateTest.MemBufferReadRectExp/* -CommandEventSyncUpdateTest.MemBufferWriteExp/* -CommandEventSyncUpdateTest.MemBufferWriteRectExp/* -CommandEventSyncUpdateTest.MemBufferFillExp/* -CommandEventSyncUpdateTest.USMPrefetchExp/* -CommandEventSyncUpdateTest.USMAdviseExp/* -CommandEventSyncUpdateTest.MultipleEventCommands/* -CommandEventSyncUpdateTest.USMFillLargePatternExp/* -CommandEventSyncUpdateTest.MemBufferFillLargePatternExp/* diff --git a/test/conformance/exp_command_buffer/exp_command_buffer_adapter_native_cpu.match b/test/conformance/exp_command_buffer/exp_command_buffer_adapter_native_cpu.match deleted file mode 100644 index d6dc9a975c..0000000000 --- a/test/conformance/exp_command_buffer/exp_command_buffer_adapter_native_cpu.match +++ /dev/null @@ -1,48 +0,0 @@ -{{OPT}}urCommandBufferReleaseCommandExpTest.Success/* -{{OPT}}urCommandBufferReleaseCommandExpTest.ReleaseCmdBufBeforeHandle/* -{{OPT}}urCommandBufferReleaseCommandExpTest.ReleaseCmdBufMultipleHandles/* -{{OPT}}urCommandBufferReleaseCommandExpTest.InvalidNullHandle/* -{{OPT}}urCommandBufferRetainCommandExpTest.Success/* -{{OPT}}urCommandBufferRetainCommandExpTest.InvalidNullHandle/* -{{OPT}}urCommandBufferAppendKernelLaunchExpTest.Basic/* -{{OPT}}urCommandBufferAppendKernelLaunchExpTest.FinalizeTwice/* -{{OPT}}BufferFillCommandTest.UpdateParameters/* -{{OPT}}BufferFillCommandTest.UpdateGlobalSize/* -{{OPT}}BufferFillCommandTest.SeparateUpdateCalls/* -{{OPT}}BufferFillCommandTest.OverrideUpdate/* -{{OPT}}BufferFillCommandTest.OverrideArgList/* -{{OPT}}InvalidUpdateTest.NotFinalizedCommandBuffer/* -{{OPT}}InvalidUpdateTest.NotUpdatableCommandBuffer/* -{{OPT}}InvalidUpdateTest.InvalidDimensions/* -{{OPT}}USMFillCommandTest.UpdateParameters/* -{{OPT}}USMFillCommandTest.UpdateNull/* -{{OPT}}USMFillCommandTest.UpdateBeforeEnqueue/* -{{OPT}}USMMultipleFillCommandTest.UpdateAllKernels/* -{{OPT}}BufferSaxpyKernelTest.UpdateParameters/* -{{OPT}}USMSaxpyKernelTest.UpdateParameters/* -{{OPT}}USMMultiSaxpyKernelTest.UpdateParameters/* -{{OPT}}USMMultiSaxpyKernelTest.UpdateWithoutBlocking/* -{{OPT}}USMMultiSaxpyKernelTest.UpdateNullptrKernel/* -{{OPT}}NDRangeUpdateTest.Update3D/* -{{OPT}}NDRangeUpdateTest.Update2D/* -{{OPT}}NDRangeUpdateTest.Update1D/* -{{OPT}}NDRangeUpdateTest.ImplToUserDefinedLocalSize/* -{{OPT}}NDRangeUpdateTest.UserToImplDefinedLocalSize/* -{{OPT}}USMSaxpyKernelTest.UpdateParameters/* -{{OPT}}USMMultiSaxpyKernelTest.UpdateParameters/* -{{OPT}}USMMultiSaxpyKernelTest.UpdateWithoutBlocking/* -{{OPT}}KernelCommandEventSyncTest.Basic/* -{{OPT}}KernelCommandEventSyncTest.InterCommandBuffer/* -{{OPT}}KernelCommandEventSyncTest.SignalWaitBeforeEnqueue/* -{{OPT}}KernelCommandEventSyncUpdateTest.Basic/* -{{OPT}}KernelCommandEventSyncUpdateTest.TwoWaitEvents/* -{{OPT}}KernelCommandEventSyncUpdateTest.InvalidWaitUpdate/* -{{OPT}}KernelCommandEventSyncUpdateTest.InvalidSignalUpdate/* -{{OPT}}LocalMemoryUpdateTest.UpdateParametersSameLocalSize/* -{{OPT}}LocalMemoryUpdateTest.UpdateLocalOnly/* -{{OPT}}LocalMemoryUpdateTest.UpdateParametersEmptyLocalSize/* -{{OPT}}LocalMemoryUpdateTest.UpdateParametersSmallerLocalSize/* -{{OPT}}LocalMemoryUpdateTest.UpdateParametersLargerLocalSize/* -{{OPT}}LocalMemoryUpdateTest.UpdateParametersPartialLocalSize/* -{{OPT}}LocalMemoryMultiUpdateTest.UpdateParameters/* -{{OPT}}LocalMemoryMultiUpdateTest.UpdateWithoutBlocking/* diff --git a/test/conformance/exp_command_buffer/fill.cpp b/test/conformance/exp_command_buffer/fill.cpp index 278cc4578e..9717a1a2ef 100644 --- a/test/conformance/exp_command_buffer/fill.cpp +++ b/test/conformance/exp_command_buffer/fill.cpp @@ -88,7 +88,7 @@ static std::vector test_cases{ template static std::string printFillTestString(const testing::TestParamInfo &info) { - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); std::stringstream test_name; @@ -98,8 +98,9 @@ printFillTestString(const testing::TestParamInfo &info) { return test_name.str(); } -UUR_TEST_SUITE_P(urCommandBufferFillCommandsTest, testing::ValuesIn(test_cases), - printFillTestString); +UUR_DEVICE_TEST_SUITE_P(urCommandBufferFillCommandsTest, + testing::ValuesIn(test_cases), + printFillTestString); TEST_P(urCommandBufferFillCommandsTest, Buffer) { ASSERT_SUCCESS(urCommandBufferAppendMemBufferFillExp( diff --git a/test/conformance/exp_command_buffer/fixtures.h b/test/conformance/exp_command_buffer/fixtures.h index 959b3e7bb1..b87efdb7d7 100644 --- a/test/conformance/exp_command_buffer/fixtures.h +++ b/test/conformance/exp_command_buffer/fixtures.h @@ -7,7 +7,9 @@ #define UR_CONFORMANCE_COMMAND_BUFFER_FIXTURES_H_INCLUDED #include + #include +#include namespace uur { namespace command_buffer { @@ -52,6 +54,8 @@ static void checkCommandBufferUpdateSupport( struct urCommandBufferExpTest : uur::urContextTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urContextTest::SetUp()); UUR_RETURN_ON_FATAL_FAILURE(checkCommandBufferSupport(device)); @@ -73,6 +77,8 @@ struct urCommandBufferExpTest : uur::urContextTest { template struct urCommandBufferExpTestWithParam : urQueueTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urQueueTestWithParam::SetUp()); UUR_RETURN_ON_FATAL_FAILURE(checkCommandBufferSupport(this->device)); @@ -93,6 +99,8 @@ struct urCommandBufferExpTestWithParam : urQueueTestWithParam { struct urCommandBufferExpExecutionTest : uur::urKernelExecutionTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urKernelExecutionTest::SetUp()); UUR_RETURN_ON_FATAL_FAILURE(checkCommandBufferSupport(device)); @@ -113,6 +121,8 @@ struct urCommandBufferExpExecutionTest : uur::urKernelExecutionTest { struct urUpdatableCommandBufferExpTest : uur::urQueueTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urQueueTest::SetUp()); UUR_RETURN_ON_FATAL_FAILURE(checkCommandBufferSupport(device)); @@ -148,6 +158,8 @@ struct urUpdatableCommandBufferExpTest : uur::urQueueTest { struct urUpdatableCommandBufferExpExecutionTest : uur::urKernelExecutionTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urKernelExecutionTest::SetUp()); ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, diff --git a/test/conformance/exp_enqueue_native/enqueue_native_cuda.cpp b/test/conformance/exp_enqueue_native/enqueue_native_cuda.cpp index 8029d3ce6f..a7e4405d52 100644 --- a/test/conformance/exp_enqueue_native/enqueue_native_cuda.cpp +++ b/test/conformance/exp_enqueue_native/enqueue_native_cuda.cpp @@ -5,14 +5,25 @@ #include #include +#include #include using T = uint32_t; struct urCudaEnqueueNativeCommandTest : uur::urQueueTest { void SetUp() { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(uur::urQueueTest::SetUp()); + ur_bool_t native_enqueue_support = false; + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP, + sizeof(native_enqueue_support), &native_enqueue_support, nullptr)); + if (!native_enqueue_support) { + GTEST_SKIP(); + } + host_vec = std::vector(global_size, 0); ASSERT_EQ(host_vec.size(), global_size); ASSERT_SUCCESS(urUSMDeviceAlloc(context, device, nullptr, nullptr, diff --git a/test/conformance/exp_enqueue_native/exp_enqueue_native_adapter_level_zero_v2.match b/test/conformance/exp_enqueue_native/exp_enqueue_native_adapter_level_zero_v2.match deleted file mode 100644 index f8cf4c4c88..0000000000 --- a/test/conformance/exp_enqueue_native/exp_enqueue_native_adapter_level_zero_v2.match +++ /dev/null @@ -1,4 +0,0 @@ -urLevelZeroEnqueueNativeCommandTest.Success* -urLevelZeroEnqueueNativeCommandTest.Dependencies* -urLevelZeroEnqueueNativeCommandTest.DependenciesURBefore* -urLevelZeroEnqueueNativeCommandTest.DependenciesURAfter* diff --git a/test/conformance/exp_launch_properties/exp_launch_properties_adapter_native_cpu.match b/test/conformance/exp_launch_properties/exp_launch_properties_adapter_native_cpu.match deleted file mode 100644 index 4a4837c5ab..0000000000 --- a/test/conformance/exp_launch_properties/exp_launch_properties_adapter_native_cpu.match +++ /dev/null @@ -1 +0,0 @@ -urEnqueueKernelLaunchCustomTest.Success/* diff --git a/test/conformance/exp_launch_properties/launch_properties.cpp b/test/conformance/exp_launch_properties/launch_properties.cpp index 23ba56ff4b..1d99c3a96a 100644 --- a/test/conformance/exp_launch_properties/launch_properties.cpp +++ b/test/conformance/exp_launch_properties/launch_properties.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urEnqueueKernelLaunchCustomTest : uur::urKernelExecutionTest { void SetUp() override { @@ -19,6 +20,7 @@ struct urEnqueueKernelLaunchCustomTest : uur::urKernelExecutionTest { UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueKernelLaunchCustomTest); TEST_P(urEnqueueKernelLaunchCustomTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); size_t returned_size; ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_EXTENSIONS, 0, @@ -77,7 +79,7 @@ TEST_P(urEnqueueKernelLaunchCustomTest, Success) { ur_bool_t cluster_launch_supported = false; ASSERT_SUCCESS(urDeviceGetInfo( - device, UR_DEVICE_INFO_CLUSTER_LAUNCH_EXP, sizeof(ur_bool_t), + device, UR_DEVICE_INFO_CLUSTER_LAUNCH_SUPPORT_EXP, sizeof(ur_bool_t), &cluster_launch_supported, nullptr)); if (cluster_launch_supported) { diff --git a/test/conformance/exp_usm_p2p/usm_p2p.cpp b/test/conformance/exp_usm_p2p/usm_p2p.cpp index 94a566914c..9b606fb1b6 100644 --- a/test/conformance/exp_usm_p2p/usm_p2p.cpp +++ b/test/conformance/exp_usm_p2p/usm_p2p.cpp @@ -4,11 +4,11 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "uur/fixtures.h" -#include "uur/raii.h" using urP2PTest = uur::urAllDevicesTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urP2PTest); -TEST_F(urP2PTest, Success) { +TEST_P(urP2PTest, Success) { if (devices.size() < 2) { GTEST_SKIP(); @@ -37,11 +37,11 @@ TEST_F(urP2PTest, Success) { ASSERT_SUCCESS(urUsmP2PPeerAccessGetInfoExp( devices[0], ///< [in] handle of the command device object devices[1], ///< [in] handle of the peer device object - UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED, sizeof(int), &value, + UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORT, sizeof(int), &value, &returned_size)); // Note that whilst it is not currently specified to be a requirement in the // specification, currently all supported backends return value = 1 for the - // UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED query when the query is true + // UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORT query when the query is true // (matching the native query return values). Generally different backends can // return different values for a given device query; however it is // advisable that for boolean queries they return the same values to indicate @@ -52,7 +52,7 @@ TEST_F(urP2PTest, Success) { // Just check that this doesn't throw since supporting peer atomics is // optional and can depend on backend/device. ASSERT_SUCCESS(urUsmP2PPeerAccessGetInfoExp( - devices[0], devices[1], UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED, + devices[0], devices[1], UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORT, sizeof(int), &value, &returned_size)); ASSERT_SUCCESS(urUsmP2PEnablePeerAccessExp(devices[0], devices[1])); diff --git a/test/conformance/integration/QueueBuffer.cpp b/test/conformance/integration/QueueBuffer.cpp index d801ebf684..4d469d6e16 100644 --- a/test/conformance/integration/QueueBuffer.cpp +++ b/test/conformance/integration/QueueBuffer.cpp @@ -6,9 +6,14 @@ #include "fixtures.h" #include #include +#include struct QueueBufferTestWithParam : uur::IntegrationQueueTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + program_name = "cpy_and_mult"; UUR_RETURN_ON_FATAL_FAILURE( uur::IntegrationQueueTestWithParam::SetUp()); @@ -31,10 +36,11 @@ struct QueueBufferTestWithParam : uur::IntegrationQueueTestWithParam { ur_mem_handle_t Buffer2 = nullptr; }; -UUR_TEST_SUITE_P(QueueBufferTestWithParam, - testing::Values(0, /* In-Order */ - UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), - uur::IntegrationQueueTestWithParam::paramPrinter); +UUR_DEVICE_TEST_SUITE_P( + QueueBufferTestWithParam, + testing::Values(0, /* In-Order */ + UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), + uur::IntegrationQueueTestWithParam::paramPrinter); /* Submits multiple kernels that interact with each other by accessing and * writing to the same buffers. diff --git a/test/conformance/integration/QueueEmptyStatus.cpp b/test/conformance/integration/QueueEmptyStatus.cpp index fd49ae7915..2a47fc426f 100644 --- a/test/conformance/integration/QueueEmptyStatus.cpp +++ b/test/conformance/integration/QueueEmptyStatus.cpp @@ -6,10 +6,14 @@ #include "fixtures.h" #include #include +#include struct QueueEmptyStatusTestWithParam : uur::IntegrationQueueTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); program_name = "multiply"; UUR_RETURN_ON_FATAL_FAILURE( @@ -98,10 +102,11 @@ struct QueueEmptyStatusTestWithParam : uur::IntegrationQueueTestWithParam { void *SharedMem = nullptr; }; -UUR_TEST_SUITE_P(QueueEmptyStatusTestWithParam, - testing::Values(0, /* In-Order */ - UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), - uur::IntegrationQueueTestWithParam::paramPrinter); +UUR_DEVICE_TEST_SUITE_P( + QueueEmptyStatusTestWithParam, + testing::Values(0, /* In-Order */ + UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), + uur::IntegrationQueueTestWithParam::paramPrinter); /* Submits kernels that have a dependency on each other and checks that the * queue submits all the work in the correct order to the device. diff --git a/test/conformance/integration/QueueUSM.cpp b/test/conformance/integration/QueueUSM.cpp index 1a48576a05..601cfd0bb1 100644 --- a/test/conformance/integration/QueueUSM.cpp +++ b/test/conformance/integration/QueueUSM.cpp @@ -6,9 +6,14 @@ #include "fixtures.h" #include #include +#include struct QueueUSMTestWithParam : uur::IntegrationQueueTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + program_name = "cpy_and_mult_usm"; UUR_RETURN_ON_FATAL_FAILURE( uur::IntegrationQueueTestWithParam::SetUp()); @@ -30,8 +35,12 @@ struct QueueUSMTestWithParam : uur::IntegrationQueueTestWithParam { } void TearDown() override { - ASSERT_SUCCESS(urUSMFree(context, DeviceMem1)); - ASSERT_SUCCESS(urUSMFree(context, DeviceMem2)); + if (DeviceMem1) { + ASSERT_SUCCESS(urUSMFree(context, DeviceMem1)); + } + if (DeviceMem2) { + ASSERT_SUCCESS(urUSMFree(context, DeviceMem2)); + } uur::IntegrationQueueTestWithParam::TearDown(); } @@ -50,10 +59,11 @@ struct QueueUSMTestWithParam : uur::IntegrationQueueTestWithParam { void *DeviceMem2 = nullptr; }; -UUR_TEST_SUITE_P(QueueUSMTestWithParam, - testing::Values(0, /* In-Order */ - UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), - uur::IntegrationQueueTestWithParam::paramPrinter); +UUR_DEVICE_TEST_SUITE_P( + QueueUSMTestWithParam, + testing::Values(0, /* In-Order */ + UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE), + uur::IntegrationQueueTestWithParam::paramPrinter); /* Submits multiple kernels that interact with each other by accessing and * writing to the same USM memory locations. diff --git a/test/conformance/integration/fixtures.h b/test/conformance/integration/fixtures.h index aca70a5245..2fa9d9f54f 100644 --- a/test/conformance/integration/fixtures.h +++ b/test/conformance/integration/fixtures.h @@ -54,10 +54,10 @@ struct IntegrationQueueTestWithParam static constexpr size_t ArraySize = 100; static constexpr uint32_t InitialValue = 100; - static std::string - paramPrinter(const ::testing::TestParamInfo< - std::tuple> &info) { - auto device = std::get<0>(info.param); + static std::string paramPrinter( + const ::testing::TestParamInfo> + &info) { + auto device = std::get<0>(info.param).device; auto param = std::get<1>(info.param); std::stringstream ss; diff --git a/test/conformance/integration/integration_adapter_level_zero.match b/test/conformance/integration/integration_adapter_level_zero.match deleted file mode 100644 index 460aa8cf4e..0000000000 --- a/test/conformance/integration/integration_adapter_level_zero.match +++ /dev/null @@ -1,3 +0,0 @@ -{{OPT}}QueueEmptyStatusTestWithParam.QueueEmptyStatusTest/* -{{OPT}}QueueUSMTestWithParam.QueueUSMTest/* -{{OPT}}QueueBufferTestWithParam.QueueBufferTest/* diff --git a/test/conformance/integration/integration_adapter_level_zero_v2.match b/test/conformance/integration/integration_adapter_level_zero_v2.match deleted file mode 100644 index 460aa8cf4e..0000000000 --- a/test/conformance/integration/integration_adapter_level_zero_v2.match +++ /dev/null @@ -1,3 +0,0 @@ -{{OPT}}QueueEmptyStatusTestWithParam.QueueEmptyStatusTest/* -{{OPT}}QueueUSMTestWithParam.QueueUSMTest/* -{{OPT}}QueueBufferTestWithParam.QueueBufferTest/* diff --git a/test/conformance/integration/integration_adapter_native_cpu.match b/test/conformance/integration/integration_adapter_native_cpu.match deleted file mode 100644 index fe5e7567ed..0000000000 --- a/test/conformance/integration/integration_adapter_native_cpu.match +++ /dev/null @@ -1,3 +0,0 @@ -QueueEmptyStatusTestWithParam.QueueEmptyStatusTest/* -QueueUSMTestWithParam.QueueUSMTest/* -QueueBufferTestWithParam.QueueBufferTest/* diff --git a/test/conformance/kernel/kernel_adapter_cuda.match b/test/conformance/kernel/kernel_adapter_cuda.match deleted file mode 100644 index cafcdf54c5..0000000000 --- a/test/conformance/kernel/kernel_adapter_cuda.match +++ /dev/null @@ -1,6 +0,0 @@ -urKernelGetGroupInfoWgSizeTest.CompileWorkGroupSize/* -{{OPT}}urKernelSetArgLocalTest.InvalidKernelArgumentIndex/* -{{OPT}}urKernelSetArgMemObjTest.InvalidKernelArgumentIndex/* -{{OPT}}urKernelSetArgPointerNegativeTest.InvalidKernelArgumentIndex/* -{{OPT}}urKernelSetArgSamplerTest.InvalidKernelArgumentIndex/* -{{OPT}}urKernelSetArgValueTest.InvalidKernelArgumentIndex/* diff --git a/test/conformance/kernel/kernel_adapter_hip.match b/test/conformance/kernel/kernel_adapter_hip.match deleted file mode 100644 index e940db8331..0000000000 --- a/test/conformance/kernel/kernel_adapter_hip.match +++ /dev/null @@ -1,6 +0,0 @@ -urKernelGetGroupInfoWgSizeTest.CompileWorkGroupSize/* -urKernelSetArgLocalTest.InvalidKernelArgumentIndex/* -urKernelSetArgMemObjTest.InvalidKernelArgumentIndex/* -urKernelSetArgPointerNegativeTest.InvalidKernelArgumentIndex/* -urKernelSetArgValueTest.InvalidKernelArgumentIndex/* -urKernelSetArgValueTest.InvalidKernelArgumentSize/* diff --git a/test/conformance/kernel/kernel_adapter_level_zero.match b/test/conformance/kernel/kernel_adapter_level_zero.match deleted file mode 100644 index 4a4868eff2..0000000000 --- a/test/conformance/kernel/kernel_adapter_level_zero.match +++ /dev/null @@ -1,4 +0,0 @@ -urKernelSetExecInfoTest.SuccessIndirectAccess/* -urKernelSetExecInfoUSMPointersTest.SuccessHost/* -urKernelSetExecInfoUSMPointersTest.SuccessDevice/* -urKernelSetExecInfoUSMPointersTest.SuccessShared/* diff --git a/test/conformance/kernel/kernel_adapter_level_zero_v2.match b/test/conformance/kernel/kernel_adapter_level_zero_v2.match deleted file mode 100644 index 4a4868eff2..0000000000 --- a/test/conformance/kernel/kernel_adapter_level_zero_v2.match +++ /dev/null @@ -1,4 +0,0 @@ -urKernelSetExecInfoTest.SuccessIndirectAccess/* -urKernelSetExecInfoUSMPointersTest.SuccessHost/* -urKernelSetExecInfoUSMPointersTest.SuccessDevice/* -urKernelSetExecInfoUSMPointersTest.SuccessShared/* diff --git a/test/conformance/kernel/kernel_adapter_native_cpu.match b/test/conformance/kernel/kernel_adapter_native_cpu.match deleted file mode 100644 index bd5333c609..0000000000 --- a/test/conformance/kernel/kernel_adapter_native_cpu.match +++ /dev/null @@ -1,86 +0,0 @@ -urKernelCreateTest.Success/* -urKernelCreateTest.InvalidNullHandleProgram/* -urKernelCreateTest.InvalidNullPointerName/* -urKernelCreateTest.InvalidNullPointerKernel/* -urKernelCreateTest.InvalidKernelName/* -urKernelCreateWithNativeHandleTest.Success/* -urKernelCreateWithNativeHandleTest.InvalidNullHandleContext/* -urKernelCreateWithNativeHandleTest.InvalidNullPointerNativeKernel/* -urKernelGetGroupInfoTest.Success/* -urKernelGetGroupInfoTest.InvalidNullHandleKernel/* -urKernelGetGroupInfoTest.InvalidNullHandleDevice/* -urKernelGetGroupInfoTest.InvalidEnumeration/* -urKernelGetGroupInfoSingleTest.CompileWorkGroupSizeEmpty/* -urKernelGetGroupInfoSingleTest.CompileMaxWorkGroupSizeEmpty/* -urKernelGetGroupInfoWgSizeTest.CompileWorkGroupSize/* -urKernelGetInfoTest.Success/* -urKernelGetInfoTest.InvalidNullHandleKernel/* -urKernelGetInfoTest.InvalidEnumeration/* -urKernelGetInfoTest.InvalidSizeZero/* -urKernelGetInfoTest.InvalidSizeSmall/* -urKernelGetInfoTest.InvalidNullPointerPropValue/* -urKernelGetInfoTest.InvalidNullPointerPropSizeRet/* -urKernelGetInfoSingleTest.KernelNameCorrect/* -urKernelGetInfoSingleTest.KernelContextCorrect/* -urKernelGetNativeHandleTest.Success/* -urKernelGetNativeHandleTest.InvalidNullHandleKernel/* -urKernelGetNativeHandleTest.InvalidNullPointerNativeKernel/* -urKernelGetSubGroupInfoTest.Success/* -urKernelGetSubGroupInfoTest.InvalidNullHandleKernel/* -urKernelGetSubGroupInfoTest.InvalidNullHandleDevice/* -urKernelGetSubGroupInfoTest.InvalidEnumeration/* -urKernelGetSubGroupInfoSingleTest.CompileNumSubgroupsIsZero/* -urKernelReleaseTest.Success/* -urKernelReleaseTest.KernelReleaseAfterProgramRelease/* -urKernelReleaseTest.InvalidNullHandleKernel/* -urKernelRetainTest.Success/* -urKernelRetainTest.InvalidNullHandleKernel/* -urKernelSetArgLocalTest.Success/* -urKernelSetArgLocalTest.InvalidNullHandleKernel/* -urKernelSetArgLocalTest.InvalidKernelArgumentIndex/* -urKernelSetArgLocalMultiTest.Basic/* -urKernelSetArgLocalMultiTest.ReLaunch/* -urKernelSetArgLocalMultiTest.Overwrite/* -urKernelSetArgMemObjTest.Success/* -urKernelSetArgMemObjTest.InvalidNullHandleKernel/* -urKernelSetArgMemObjTest.InvalidKernelArgumentIndex/* -urKernelSetArgPointerTest.SuccessHost/* -urKernelSetArgPointerTest.SuccessDevice/* -urKernelSetArgPointerTest.SuccessShared/* -urKernelSetArgPointerNegativeTest.InvalidNullHandleKernel/* -urKernelSetArgPointerNegativeTest.InvalidKernelArgumentIndex/* -urKernelSetArgSamplerTestWithParam.Success/* -urKernelSetArgSamplerTest.SuccessWithProps/* -urKernelSetArgSamplerTest.InvalidNullHandleKernel/* -urKernelSetArgSamplerTest.InvalidNullHandleArgValue/* -urKernelSetArgSamplerTest.InvalidKernelArgumentIndex/* -urKernelSetArgValueTest.Success/* -urKernelSetArgValueTest.InvalidNullHandleKernel/* -urKernelSetArgValueTest.InvalidNullPointerArgValue/* -urKernelSetArgValueTest.InvalidKernelArgumentIndex/* -urKernelSetArgValueTest.InvalidKernelArgumentSize/* -urKernelSetExecInfoTest.SuccessIndirectAccess/* -urKernelSetExecInfoTest.InvalidNullHandleKernel/* -urKernelSetExecInfoTest.InvalidEnumeration/* -urKernelSetExecInfoTest.InvalidNullPointerPropValue/* -urKernelSetExecInfoUSMPointersTest.SuccessHost/* -urKernelSetExecInfoUSMPointersTest.SuccessDevice/* -urKernelSetExecInfoUSMPointersTest.SuccessShared/* -urKernelSetExecInfoCacheConfigTest.Success/* -urKernelSetSpecializationConstantsTest.Success/* -urKernelSetSpecializationConstantsTest.InvalidNullHandleKernel/* -urKernelSetSpecializationConstantsTest.InvalidNullPointerSpecConstants/* -urKernelSetSpecializationConstantsTest.InvalidSizeCount/* -urKernelSetSpecializationConstantsTest.InvalidValueSize/* -urKernelSetSpecializationConstantsTest.InvalidValueId/* -urKernelSetSpecializationConstantsTest.InvalidValuePtr/* -urKernelSetSpecializationConstantsNegativeTest.Unsupported/* -urKernelGetSuggestedLocalWorkSizeTest.Success/* -urKernelGetSuggestedLocalWorkSizeTest.Success2D/* -urKernelGetSuggestedLocalWorkSizeTest.Success3D/* -urKernelGetSuggestedLocalWorkSizeTest.InvalidNullHandleKernel/* -urKernelGetSuggestedLocalWorkSizeTest.InvalidNullHandleQueue/* -urKernelGetSuggestedLocalWorkSizeTest.InvalidWorkDimension/* -urKernelGetSuggestedLocalWorkSizeTest.InvalidGlobalOffset/* -urKernelGetSuggestedLocalWorkSizeTest.InvalidGlobalSize/* -urKernelGetSuggestedLocalWorkSizeTest.InvalidSuggestedLocalWorkSize/* diff --git a/test/conformance/kernel/urKernelCreate.cpp b/test/conformance/kernel/urKernelCreate.cpp index 4629d3f87e..f372f15a0e 100644 --- a/test/conformance/kernel/urKernelCreate.cpp +++ b/test/conformance/kernel/urKernelCreate.cpp @@ -54,8 +54,9 @@ TEST_P(urKernelCreateTest, InvalidKernelName) { } using urMultiDeviceKernelCreateTest = uur::urMultiDeviceQueueTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMultiDeviceKernelCreateTest); -TEST_F(urMultiDeviceKernelCreateTest, WithProgramBuild) { +TEST_P(urMultiDeviceKernelCreateTest, WithProgramBuild) { constexpr size_t global_offset = 0; constexpr size_t n_dimensions = 1; constexpr size_t global_size = 100; @@ -67,7 +68,6 @@ TEST_F(urMultiDeviceKernelCreateTest, WithProgramBuild) { std::shared_ptr> il_binary; uur::KernelsEnvironment::instance->LoadSource("foo", il_binary); - auto &devices = uur::KernelsEnvironment::instance->devices; for (size_t i = 0; i < devices.size(); i++) { uur::raii::Program program; uur::raii::Kernel kernel; @@ -90,7 +90,7 @@ TEST_F(urMultiDeviceKernelCreateTest, WithProgramBuild) { } } -TEST_F(urMultiDeviceKernelCreateTest, WithProgramCompileAndLink) { +TEST_P(urMultiDeviceKernelCreateTest, WithProgramCompileAndLink) { constexpr size_t global_offset = 0; constexpr size_t n_dimensions = 1; constexpr size_t global_size = 100; @@ -102,7 +102,6 @@ TEST_F(urMultiDeviceKernelCreateTest, WithProgramCompileAndLink) { std::shared_ptr> il_binary; uur::KernelsEnvironment::instance->LoadSource("foo", il_binary); - auto &devices = uur::KernelsEnvironment::instance->devices; for (size_t i = 0; i < devices.size(); i++) { uur::raii::Program program; uur::raii::Kernel kernel; diff --git a/test/conformance/kernel/urKernelGetGroupInfo.cpp b/test/conformance/kernel/urKernelGetGroupInfo.cpp index 35e837e97a..2de90a337a 100644 --- a/test/conformance/kernel/urKernelGetGroupInfo.cpp +++ b/test/conformance/kernel/urKernelGetGroupInfo.cpp @@ -5,11 +5,12 @@ #include #include +#include using urKernelGetGroupInfoTest = uur::urKernelTestWithParam; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urKernelGetGroupInfoTest, ::testing::Values(UR_KERNEL_GROUP_INFO_GLOBAL_WORK_SIZE, UR_KERNEL_GROUP_INFO_WORK_GROUP_SIZE, @@ -78,6 +79,9 @@ TEST_P(urKernelGetGroupInfoTest, InvalidEnumeration) { } TEST_P(urKernelGetGroupInfoWgSizeTest, CompileWorkGroupSize) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + std::array read_dims{1, 1, 1}; ASSERT_SUCCESS(urKernelGetGroupInfo( kernel, device, UR_KERNEL_GROUP_INFO_COMPILE_WORK_GROUP_SIZE, diff --git a/test/conformance/kernel/urKernelGetInfo.cpp b/test/conformance/kernel/urKernelGetInfo.cpp index 4749abc367..9488bcb382 100644 --- a/test/conformance/kernel/urKernelGetInfo.cpp +++ b/test/conformance/kernel/urKernelGetInfo.cpp @@ -4,10 +4,11 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urKernelGetInfoTest = uur::urKernelTestWithParam; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urKernelGetInfoTest, ::testing::Values(UR_KERNEL_INFO_FUNCTION_NAME, UR_KERNEL_INFO_NUM_ARGS, UR_KERNEL_INFO_REFERENCE_COUNT, UR_KERNEL_INFO_CONTEXT, @@ -20,6 +21,12 @@ UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelGetInfoSingleTest); TEST_P(urKernelGetInfoTest, Success) { auto property_name = getParam(); + + if (property_name == UR_KERNEL_INFO_NUM_REGS) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::OpenCL{}); + } + size_t property_size = 0; std::vector property_value; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( diff --git a/test/conformance/kernel/urKernelGetSubGroupInfo.cpp b/test/conformance/kernel/urKernelGetSubGroupInfo.cpp index f2fc8f0197..692672ed04 100644 --- a/test/conformance/kernel/urKernelGetSubGroupInfo.cpp +++ b/test/conformance/kernel/urKernelGetSubGroupInfo.cpp @@ -8,7 +8,7 @@ using urKernelGetSubGroupInfoTest = uur::urKernelTestWithParam; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urKernelGetSubGroupInfoTest, ::testing::Values(UR_KERNEL_SUB_GROUP_INFO_MAX_SUB_GROUP_SIZE, UR_KERNEL_SUB_GROUP_INFO_MAX_NUM_SUB_GROUPS, diff --git a/test/conformance/kernel/urKernelSetArgLocal.cpp b/test/conformance/kernel/urKernelSetArgLocal.cpp index 380085bd16..dc015323c9 100644 --- a/test/conformance/kernel/urKernelSetArgLocal.cpp +++ b/test/conformance/kernel/urKernelSetArgLocal.cpp @@ -5,6 +5,7 @@ #include #include +#include struct urKernelSetArgLocalTest : uur::urKernelTest { void SetUp() { @@ -25,6 +26,9 @@ TEST_P(urKernelSetArgLocalTest, InvalidNullHandleKernel) { } TEST_P(urKernelSetArgLocalTest, InvalidKernelArgumentIndex) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + uint32_t num_kernel_args = 0; ASSERT_SUCCESS(urKernelGetInfo(kernel, UR_KERNEL_INFO_NUM_ARGS, sizeof(num_kernel_args), &num_kernel_args, diff --git a/test/conformance/kernel/urKernelSetArgMemObj.cpp b/test/conformance/kernel/urKernelSetArgMemObj.cpp index 0a83882465..7055d84e82 100644 --- a/test/conformance/kernel/urKernelSetArgMemObj.cpp +++ b/test/conformance/kernel/urKernelSetArgMemObj.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urKernelSetArgMemObjTest : uur::urKernelTest { void SetUp() { @@ -35,6 +36,9 @@ TEST_P(urKernelSetArgMemObjTest, InvalidNullHandleKernel) { } TEST_P(urKernelSetArgMemObjTest, InvalidKernelArgumentIndex) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + uint32_t num_kernel_args = 0; ASSERT_SUCCESS(urKernelGetInfo(kernel, UR_KERNEL_INFO_NUM_ARGS, sizeof(num_kernel_args), &num_kernel_args, diff --git a/test/conformance/kernel/urKernelSetArgPointer.cpp b/test/conformance/kernel/urKernelSetArgPointer.cpp index e037ada8f1..ef20ab18b3 100644 --- a/test/conformance/kernel/urKernelSetArgPointer.cpp +++ b/test/conformance/kernel/urKernelSetArgPointer.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urKernelSetArgPointerTest : uur::urKernelExecutionTest { void SetUp() { @@ -130,7 +131,7 @@ struct urKernelSetArgPointerNegativeTest : urKernelSetArgPointerTest { void SetUp() { UUR_RETURN_ON_FATAL_FAILURE(urKernelSetArgPointerTest::SetUp()); - SetUpAllocation(); + UUR_RETURN_ON_FATAL_FAILURE(SetUpAllocation()); ASSERT_NE(allocation, nullptr); } }; @@ -142,6 +143,9 @@ TEST_P(urKernelSetArgPointerNegativeTest, InvalidNullHandleKernel) { } TEST_P(urKernelSetArgPointerNegativeTest, InvalidKernelArgumentIndex) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + uint32_t num_kernel_args = 0; ASSERT_SUCCESS(urKernelGetInfo(kernel, UR_KERNEL_INFO_NUM_ARGS, sizeof(num_kernel_args), &num_kernel_args, diff --git a/test/conformance/kernel/urKernelSetArgSampler.cpp b/test/conformance/kernel/urKernelSetArgSampler.cpp index 83a65613e5..c105660c9b 100644 --- a/test/conformance/kernel/urKernelSetArgSampler.cpp +++ b/test/conformance/kernel/urKernelSetArgSampler.cpp @@ -4,10 +4,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urKernelSetArgSamplerTestWithParam : uur::urBaseKernelTestWithParam { void SetUp() { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA Emulation Device"}); + const auto param = getParam(); const auto normalized = std::get<0>(param); const auto addr_mode = std::get<1>(param); @@ -48,7 +51,7 @@ struct urKernelSetArgSamplerTestWithParam ur_sampler_handle_t sampler = nullptr; }; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urKernelSetArgSamplerTestWithParam, ::testing::Combine( ::testing::Values(true, false), @@ -68,6 +71,8 @@ TEST_P(urKernelSetArgSamplerTestWithParam, Success) { struct urKernelSetArgSamplerTest : uur::urBaseKernelTest { void SetUp() { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA Emulation Device"}); + program_name = "image_copy"; UUR_RETURN_ON_FATAL_FAILURE(urBaseKernelTest::SetUp()); @@ -120,6 +125,8 @@ TEST_P(urKernelSetArgSamplerTest, InvalidNullHandleArgValue) { } TEST_P(urKernelSetArgSamplerTest, InvalidKernelArgumentIndex) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + uint32_t num_kernel_args = 0; ASSERT_SUCCESS(urKernelGetInfo(kernel, UR_KERNEL_INFO_NUM_ARGS, sizeof(num_kernel_args), &num_kernel_args, diff --git a/test/conformance/kernel/urKernelSetArgValue.cpp b/test/conformance/kernel/urKernelSetArgValue.cpp index 84dd3ee86c..15151d70c8 100644 --- a/test/conformance/kernel/urKernelSetArgValue.cpp +++ b/test/conformance/kernel/urKernelSetArgValue.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urKernelSetArgValueTest : uur::urKernelTest { void SetUp() { @@ -33,6 +34,9 @@ TEST_P(urKernelSetArgValueTest, InvalidNullPointerArgValue) { } TEST_P(urKernelSetArgValueTest, InvalidKernelArgumentIndex) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + uint32_t num_kernel_args = 0; ASSERT_SUCCESS(urKernelGetInfo(kernel, UR_KERNEL_INFO_NUM_ARGS, sizeof(num_kernel_args), &num_kernel_args, @@ -45,6 +49,9 @@ TEST_P(urKernelSetArgValueTest, InvalidKernelArgumentIndex) { } TEST_P(urKernelSetArgValueTest, InvalidKernelArgumentSize) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) UHD Graphics 770"}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE, urKernelSetArgValue(kernel, 2, 0, nullptr, &arg_value)); } diff --git a/test/conformance/kernel/urKernelSetExecInfo.cpp b/test/conformance/kernel/urKernelSetExecInfo.cpp index aa1a2c1088..5336752f39 100644 --- a/test/conformance/kernel/urKernelSetExecInfo.cpp +++ b/test/conformance/kernel/urKernelSetExecInfo.cpp @@ -4,11 +4,15 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urKernelSetExecInfoTest = uur::urKernelTest; UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetExecInfoTest); TEST_P(urKernelSetExecInfoTest, SuccessIndirectAccess) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + bool property_value = false; ASSERT_SUCCESS( urKernelSetExecInfo(kernel, UR_KERNEL_EXEC_INFO_USM_INDIRECT_ACCESS, @@ -58,6 +62,9 @@ struct urKernelSetExecInfoUSMPointersTest : uur::urKernelTest { UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetExecInfoUSMPointersTest); TEST_P(urKernelSetExecInfoUSMPointersTest, SuccessHost) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + ur_device_usm_access_capability_flags_t host_supported = 0; ASSERT_SUCCESS(uur::GetDeviceUSMHostSupport(device, host_supported)); if (!host_supported) { @@ -74,6 +81,9 @@ TEST_P(urKernelSetExecInfoUSMPointersTest, SuccessHost) { } TEST_P(urKernelSetExecInfoUSMPointersTest, SuccessDevice) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + ur_device_usm_access_capability_flags_t device_supported = 0; ASSERT_SUCCESS(uur::GetDeviceUSMDeviceSupport(device, device_supported)); if (!device_supported) { @@ -90,6 +100,9 @@ TEST_P(urKernelSetExecInfoUSMPointersTest, SuccessDevice) { } TEST_P(urKernelSetExecInfoUSMPointersTest, SuccessShared) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + ur_device_usm_access_capability_flags_t shared_supported = 0; ASSERT_SUCCESS( uur::GetDeviceUSMSingleSharedSupport(device, shared_supported)); @@ -109,11 +122,12 @@ TEST_P(urKernelSetExecInfoUSMPointersTest, SuccessShared) { using urKernelSetExecInfoCacheConfigTest = uur::urKernelTestWithParam; -UUR_TEST_SUITE_P(urKernelSetExecInfoCacheConfigTest, - ::testing::Values(UR_KERNEL_CACHE_CONFIG_DEFAULT, - UR_KERNEL_CACHE_CONFIG_LARGE_SLM, - UR_KERNEL_CACHE_CONFIG_LARGE_DATA), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urKernelSetExecInfoCacheConfigTest, + ::testing::Values(UR_KERNEL_CACHE_CONFIG_DEFAULT, + UR_KERNEL_CACHE_CONFIG_LARGE_SLM, + UR_KERNEL_CACHE_CONFIG_LARGE_DATA), + uur::deviceTestWithParamPrinter); TEST_P(urKernelSetExecInfoCacheConfigTest, Success) { auto property_value = getParam(); diff --git a/test/conformance/memory-migrate/urMemBufferMigrateAcrossDevices.cpp b/test/conformance/memory-migrate/urMemBufferMigrateAcrossDevices.cpp index f7617a2940..040634898f 100644 --- a/test/conformance/memory-migrate/urMemBufferMigrateAcrossDevices.cpp +++ b/test/conformance/memory-migrate/urMemBufferMigrateAcrossDevices.cpp @@ -148,8 +148,9 @@ struct urMultiDeviceContextMemBufferTest : urMultiDeviceContextTest { std::vector kernels; std::vector metadatas{}; }; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMultiDeviceContextMemBufferTest); -TEST_F(urMultiDeviceContextMemBufferTest, WriteRead) { +TEST_P(urMultiDeviceContextMemBufferTest, WriteRead) { if (num_devices == 1) { GTEST_SKIP(); } @@ -173,7 +174,7 @@ TEST_F(urMultiDeviceContextMemBufferTest, WriteRead) { } } -TEST_F(urMultiDeviceContextMemBufferTest, FillRead) { +TEST_P(urMultiDeviceContextMemBufferTest, FillRead) { if (num_devices == 1) { GTEST_SKIP(); } @@ -197,7 +198,7 @@ TEST_F(urMultiDeviceContextMemBufferTest, FillRead) { } } -TEST_F(urMultiDeviceContextMemBufferTest, WriteKernelRead) { +TEST_P(urMultiDeviceContextMemBufferTest, WriteKernelRead) { if (num_devices == 1) { GTEST_SKIP(); } @@ -233,7 +234,7 @@ TEST_F(urMultiDeviceContextMemBufferTest, WriteKernelRead) { } } -TEST_F(urMultiDeviceContextMemBufferTest, WriteKernelKernelRead) { +TEST_P(urMultiDeviceContextMemBufferTest, WriteKernelKernelRead) { if (num_devices == 1) { GTEST_SKIP(); } diff --git a/test/conformance/memory/memory_adapter_cuda.match b/test/conformance/memory/memory_adapter_cuda.match deleted file mode 100644 index 255559f575..0000000000 --- a/test/conformance/memory/memory_adapter_cuda.match +++ /dev/null @@ -1,6 +0,0 @@ -urMemImageCreateTest.InvalidSize/* -{{OPT}}urMemImageCremBufferCrateTestWith1DMemoryTypeParam.Success/*__UR_MEM_TYPE_IMAGE1D_ARRAY -{{OPT}}urMemImageCreateTestWith2DMemoryTypeParam.Success/*__UR_MEM_TYPE_IMAGE2D_ARRAY -urMemBufferCreateWithNativeHandleTest.Success/* -urMemBufferCreateWithNativeHandleTest.SuccessWithOwnedNativeHandle/* -urMemBufferCreateWithNativeHandleTest.SuccessWithUnOwnedNativeHandle/* diff --git a/test/conformance/memory/memory_adapter_hip.match b/test/conformance/memory/memory_adapter_hip.match deleted file mode 100644 index 2acbdfb2e8..0000000000 --- a/test/conformance/memory/memory_adapter_hip.match +++ /dev/null @@ -1,4 +0,0 @@ -urMemImageCreateTest.InvalidSize/* -urMemBufferCreateWithNativeHandleTest.Success/* -urMemBufferCreateWithNativeHandleTest.SuccessWithOwnedNativeHandle/* -urMemBufferCreateWithNativeHandleTest.SuccessWithUnOwnedNativeHandle/* diff --git a/test/conformance/memory/memory_adapter_level_zero.match b/test/conformance/memory/memory_adapter_level_zero.match deleted file mode 100644 index d137fc5ac1..0000000000 --- a/test/conformance/memory/memory_adapter_level_zero.match +++ /dev/null @@ -1,15 +0,0 @@ -{{OPT}}urMemBufferMultiQueueMemBufferTest.WriteBack -urMemBufferPartitionWithFlagsTest.Success/*__UR_MEM_FLAG_WRITE_ONLY -urMemBufferPartitionWithFlagsTest.Success/*__UR_MEM_FLAG_READ_ONLY -urMemBufferPartitionTest.InvalidValueCreateType/* -urMemBufferPartitionTest.InvalidValueBufferCreateInfoOutOfBounds/* -{{OPT}}urMemImageCreateWithNativeHandleTest.Success/* -{{OPT}}urMemGetInfoImageTest.Success/*__UR_MEM_INFO_SIZE -{{OPT}}urMemImageCreateTestWithImageFormatParam.Success/*__UR_IMAGE_CHANNEL_ORDER_RGBA__* - -# These tests fail in the "Multi device testing" job, but pass in the hardware specific test -{{OPT}}urMemImageCreateTest.InvalidImageDescStype/* -{{OPT}}urMemImageCreateTest.InvalidSize/* -{{OPT}}urMemImageCreateWithHostPtrFlagsTest.Success/* -{{OPT}}urMemImageGetInfoTest.InvalidSizeSmall/* -{{OPT}}urMemImageGetInfoTest.Success/* diff --git a/test/conformance/memory/memory_adapter_native_cpu.match b/test/conformance/memory/memory_adapter_native_cpu.match deleted file mode 100644 index 4465185bed..0000000000 --- a/test/conformance/memory/memory_adapter_native_cpu.match +++ /dev/null @@ -1,15 +0,0 @@ -urMemBufferPartitionWithFlagsTest.Success/*__UR_MEM_FLAG_WRITE_ONLY -urMemBufferPartitionWithFlagsTest.Success/*__UR_MEM_FLAG_READ_ONLY -urMemBufferPartitionTest.InvalidValueCreateType/* -urMemBufferPartitionTest.InvalidValueBufferCreateInfoOutOfBounds/* -urMemGetInfoTestWithParam.Success/* -urMemGetInfoTest.InvalidSizeSmall/* -urMemReleaseTest.Success/* -urMemReleaseTest.CheckReferenceCount/* -urMemRetainTest.Success/* -urMemRetainTest.CheckReferenceCount/* -urMemBufferCreateWithNativeHandleTest.Success/* -urMemBufferCreateWithNativeHandleTest.SuccessWithOwnedNativeHandle/* -urMemBufferCreateWithNativeHandleTest.SuccessWithUnOwnedNativeHandle/* -urMemBufferCreateWithNativeHandleTest.InvalidNullHandle/* -urMemBufferCreateWithNativeHandleTest.InvalidNullPointer/* diff --git a/test/conformance/memory/urMemBufferCreate.cpp b/test/conformance/memory/urMemBufferCreate.cpp index df90c4b63a..7238119de5 100644 --- a/test/conformance/memory/urMemBufferCreate.cpp +++ b/test/conformance/memory/urMemBufferCreate.cpp @@ -10,12 +10,12 @@ using urMemBufferCreateTestWithFlagsParam = uur::urContextTestWithParam; using urMemBufferCreateWithFlagsTest = urMemBufferCreateTestWithFlagsParam; -UUR_TEST_SUITE_P(urMemBufferCreateWithFlagsTest, - ::testing::Values(UR_MEM_FLAG_READ_WRITE, - UR_MEM_FLAG_WRITE_ONLY, - UR_MEM_FLAG_READ_ONLY, - UR_MEM_FLAG_ALLOC_HOST_POINTER), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urMemBufferCreateWithFlagsTest, + ::testing::Values(UR_MEM_FLAG_READ_WRITE, + UR_MEM_FLAG_WRITE_ONLY, + UR_MEM_FLAG_READ_ONLY, + UR_MEM_FLAG_ALLOC_HOST_POINTER), + uur::deviceTestWithParamPrinter); TEST_P(urMemBufferCreateWithFlagsTest, Success) { uur::raii::Mem buffer = nullptr; @@ -87,10 +87,10 @@ TEST_P(urMemBufferCreateTest, InvalidHostPtrValidHost) { using urMemBufferCreateWithHostPtrFlagsTest = urMemBufferCreateTestWithFlagsParam; -UUR_TEST_SUITE_P(urMemBufferCreateWithHostPtrFlagsTest, - ::testing::Values(UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER, - UR_MEM_FLAG_USE_HOST_POINTER), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urMemBufferCreateWithHostPtrFlagsTest, + ::testing::Values(UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER, + UR_MEM_FLAG_USE_HOST_POINTER), + uur::deviceTestWithParamPrinter); TEST_P(urMemBufferCreateWithHostPtrFlagsTest, SUCCESS) { uur::raii::Mem host_ptr_buffer = nullptr; diff --git a/test/conformance/memory/urMemBufferCreateWithNativeHandle.cpp b/test/conformance/memory/urMemBufferCreateWithNativeHandle.cpp index 78e2510369..3cf2250711 100644 --- a/test/conformance/memory/urMemBufferCreateWithNativeHandle.cpp +++ b/test/conformance/memory/urMemBufferCreateWithNativeHandle.cpp @@ -4,12 +4,18 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include #include using urMemBufferCreateWithNativeHandleTest = uur::urMemBufferTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemBufferCreateWithNativeHandleTest); TEST_P(urMemBufferCreateWithNativeHandleTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_native_handle_t hNativeMem = 0; ASSERT_SUCCESS(urMemGetNativeHandle(buffer, device, &hNativeMem)); @@ -30,6 +36,11 @@ TEST_P(urMemBufferCreateWithNativeHandleTest, Success) { } TEST_P(urMemBufferCreateWithNativeHandleTest, SuccessWithOwnedNativeHandle) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_native_handle_t native_handle = 0; ASSERT_SUCCESS(urMemGetNativeHandle(buffer, device, &native_handle)); @@ -51,6 +62,11 @@ TEST_P(urMemBufferCreateWithNativeHandleTest, SuccessWithOwnedNativeHandle) { } TEST_P(urMemBufferCreateWithNativeHandleTest, SuccessWithUnOwnedNativeHandle) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_native_handle_t native_handle = 0; ASSERT_SUCCESS(urMemGetNativeHandle(buffer, device, &native_handle)); @@ -72,6 +88,9 @@ TEST_P(urMemBufferCreateWithNativeHandleTest, SuccessWithUnOwnedNativeHandle) { } TEST_P(urMemBufferCreateWithNativeHandleTest, InvalidNullHandle) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_native_handle_t hNativeMem = 0; ASSERT_SUCCESS(urMemGetNativeHandle(buffer, device, &hNativeMem)); @@ -87,6 +106,9 @@ TEST_P(urMemBufferCreateWithNativeHandleTest, InvalidNullHandle) { } TEST_P(urMemBufferCreateWithNativeHandleTest, InvalidNullPointer) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_native_handle_t hNativeMem = 0; ASSERT_SUCCESS(urMemGetNativeHandle(buffer, device, &hNativeMem)); @@ -101,7 +123,11 @@ TEST_P(urMemBufferCreateWithNativeHandleTest, InvalidNullPointer) { } using urMemBufferMultiQueueMemBufferTest = uur::urMultiDeviceMemBufferQueueTest; -TEST_F(urMemBufferMultiQueueMemBufferTest, WriteBack) { +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMemBufferMultiQueueMemBufferTest); + +TEST_P(urMemBufferMultiQueueMemBufferTest, WriteBack) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + void *ptr; ASSERT_SUCCESS(urUSMHostAlloc(context, nullptr, nullptr, size, &ptr)); ur_mem_handle_t mem = nullptr; diff --git a/test/conformance/memory/urMemBufferPartition.cpp b/test/conformance/memory/urMemBufferPartition.cpp index fca20693c7..caa6111c5b 100644 --- a/test/conformance/memory/urMemBufferPartition.cpp +++ b/test/conformance/memory/urMemBufferPartition.cpp @@ -4,17 +4,30 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "uur/fixtures.h" +#include "uur/known_failure.h" #include "uur/raii.h" using urMemBufferPartitionWithFlagsTest = uur::urContextTestWithParam; -UUR_TEST_SUITE_P(urMemBufferPartitionWithFlagsTest, - ::testing::Values(UR_MEM_FLAG_READ_WRITE, - UR_MEM_FLAG_WRITE_ONLY, - UR_MEM_FLAG_READ_ONLY), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urMemBufferPartitionWithFlagsTest, + ::testing::Values(UR_MEM_FLAG_READ_WRITE, + UR_MEM_FLAG_WRITE_ONLY, + UR_MEM_FLAG_READ_ONLY), + uur::deviceTestWithParamPrinter); TEST_P(urMemBufferPartitionWithFlagsTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + + if (getParam() == UR_MEM_FLAG_WRITE_ONLY) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + } + + if (getParam() == UR_MEM_FLAG_READ_ONLY) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + } + uur::raii::Mem buffer = nullptr; ASSERT_SUCCESS( @@ -53,6 +66,10 @@ TEST_P(urMemBufferPartitionTest, InvalidEnumerationFlags) { } TEST_P(urMemBufferPartitionTest, InvalidEnumerationBufferCreateType) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_buffer_region_t region{UR_STRUCTURE_TYPE_BUFFER_REGION, nullptr, 0, 1024}; uur::raii::Mem partition = nullptr; @@ -89,6 +106,9 @@ TEST_P(urMemBufferPartitionTest, InvalidBufferSize) { } TEST_P(urMemBufferPartitionTest, InvalidValueCreateType) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + // create a read only buffer uur::raii::Mem ro_buffer = nullptr; ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_READ_ONLY, 4096, @@ -105,6 +125,10 @@ TEST_P(urMemBufferPartitionTest, InvalidValueCreateType) { } TEST_P(urMemBufferPartitionTest, InvalidValueBufferCreateInfoOutOfBounds) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_buffer_region_t region{UR_STRUCTURE_TYPE_BUFFER_REGION, nullptr, 0, 8192}; uur::raii::Mem partition = nullptr; diff --git a/test/conformance/memory/urMemGetInfo.cpp b/test/conformance/memory/urMemGetInfo.cpp index ddcc2761d0..490de271bb 100644 --- a/test/conformance/memory/urMemGetInfo.cpp +++ b/test/conformance/memory/urMemGetInfo.cpp @@ -5,6 +5,7 @@ #include #include #include +#include using urMemGetInfoTestWithParam = uur::urMemBufferTestWithParam; @@ -16,11 +17,13 @@ static std::unordered_map mem_info_size_map = { {UR_MEM_INFO_REFERENCE_COUNT, sizeof(uint32_t)}, }; -UUR_TEST_SUITE_P(urMemGetInfoTestWithParam, - ::testing::ValuesIn(mem_info_values), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urMemGetInfoTestWithParam, + ::testing::ValuesIn(mem_info_values), + uur::deviceTestWithParamPrinter); TEST_P(urMemGetInfoTestWithParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_mem_info_t info = getParam(); size_t size; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -83,6 +86,8 @@ TEST_P(urMemGetInfoTest, InvalidSizeZero) { } TEST_P(urMemGetInfoTest, InvalidSizeSmall) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t mem_size = 0; ASSERT_EQ_RESULT(urMemGetInfo(buffer, UR_MEM_INFO_SIZE, sizeof(mem_size) - 1, &mem_size, nullptr), @@ -103,11 +108,19 @@ TEST_P(urMemGetInfoTest, InvalidNullPointerPropSizeRet) { } using urMemGetInfoImageTest = uur::urMemImageTestWithParam; -UUR_TEST_SUITE_P(urMemGetInfoImageTest, ::testing::ValuesIn(mem_info_values), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urMemGetInfoImageTest, + ::testing::ValuesIn(mem_info_values), + uur::deviceTestWithParamPrinter); TEST_P(urMemGetInfoImageTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + ur_mem_info_t info = getParam(); + + if (info == UR_MEM_INFO_SIZE) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + } + size_t size; ASSERT_SUCCESS(urMemGetInfo(image, info, 0, nullptr, &size)); ASSERT_NE(size, 0); diff --git a/test/conformance/memory/urMemImageCreate.cpp b/test/conformance/memory/urMemImageCreate.cpp index bfb4f6e719..adde3f29de 100644 --- a/test/conformance/memory/urMemImageCreate.cpp +++ b/test/conformance/memory/urMemImageCreate.cpp @@ -2,6 +2,7 @@ // Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include "uur/known_failure.h" #include #include @@ -24,6 +25,7 @@ static ur_image_desc_t image_desc{ struct urMemImageCreateTest : public uur::urContextTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA Emulation Device"}); UUR_RETURN_ON_FATAL_FAILURE(uur::urContextTest::SetUp()); uur::raii::Mem image_handle = nullptr; @@ -69,12 +71,18 @@ struct urMemImageCreateTestWithParam using urMemImageCreateTestWith1DMemoryTypeParam = urMemImageCreateTestWithParam; -UUR_TEST_SUITE_P(urMemImageCreateTestWith1DMemoryTypeParam, - ::testing::Values(UR_MEM_TYPE_IMAGE1D, - UR_MEM_TYPE_IMAGE1D_ARRAY), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urMemImageCreateTestWith1DMemoryTypeParam, + ::testing::Values(UR_MEM_TYPE_IMAGE1D, + UR_MEM_TYPE_IMAGE1D_ARRAY), + uur::deviceTestWithParamPrinter); TEST_P(urMemImageCreateTestWith1DMemoryTypeParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA Emulation Device"}); + + if (getParam() == UR_MEM_TYPE_IMAGE1D_ARRAY) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + } + ur_image_desc_t image_desc_with_param{ UR_STRUCTURE_TYPE_IMAGE_DESC, ///< [in] type of this structure nullptr, ///< [in][optional] pointer to extension-specific structure @@ -99,12 +107,18 @@ TEST_P(urMemImageCreateTestWith1DMemoryTypeParam, Success) { using urMemImageCreateTestWith2DMemoryTypeParam = urMemImageCreateTestWithParam; -UUR_TEST_SUITE_P(urMemImageCreateTestWith2DMemoryTypeParam, - ::testing::Values(UR_MEM_TYPE_IMAGE2D, - UR_MEM_TYPE_IMAGE2D_ARRAY), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urMemImageCreateTestWith2DMemoryTypeParam, + ::testing::Values(UR_MEM_TYPE_IMAGE2D, + UR_MEM_TYPE_IMAGE2D_ARRAY), + uur::deviceTestWithParamPrinter); TEST_P(urMemImageCreateTestWith2DMemoryTypeParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA Emulation Device"}); + + if (getParam() == UR_MEM_TYPE_IMAGE2D_ARRAY) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + } + ur_image_desc_t image_desc_with_param{ UR_STRUCTURE_TYPE_IMAGE_DESC, ///< [in] type of this structure nullptr, ///< [in][optional] pointer to extension-specific structure @@ -188,6 +202,12 @@ TEST_P(urMemImageCreateTest, InvalidNullPointerImageFormat) { } TEST_P(urMemImageCreateTest, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) UHD Graphics 770"}); + + // This fail is specific to the "Multi device testing" ci job. + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); uur::raii::Mem image_handle = nullptr; @@ -217,6 +237,9 @@ TEST_P(urMemImageCreateTest, InvalidSize) { } TEST_P(urMemImageCreateTest, InvalidImageDescStype) { + // This fail is specific to the "Multi device testing" ci job. + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + uur::raii::Mem image_handle = nullptr; ur_image_desc_t invalid_image_desc = image_desc; invalid_image_desc.stype = UR_STRUCTURE_TYPE_FORCE_UINT32; @@ -308,12 +331,17 @@ TEST_P(urMemImageCreateTest, InvalidHostPtrValidHost) { using urMemImageCreateWithHostPtrFlagsTest = urMemImageCreateTestWithParam; -UUR_TEST_SUITE_P(urMemImageCreateWithHostPtrFlagsTest, - ::testing::Values(UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER, - UR_MEM_FLAG_USE_HOST_POINTER), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urMemImageCreateWithHostPtrFlagsTest, + ::testing::Values(UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER, + UR_MEM_FLAG_USE_HOST_POINTER), + uur::deviceTestWithParamPrinter); TEST_P(urMemImageCreateWithHostPtrFlagsTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA Emulation Device"}); + + // This fail is specific to the "Multi device testing" ci job. + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + uur::raii::Mem host_ptr_buffer = nullptr; ASSERT_SUCCESS(urMemImageCreate(context, UR_MEM_FLAG_ALLOC_HOST_POINTER, &image_format, &image_desc, nullptr, diff --git a/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp b/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp index b72b5a9425..28f5ae6c37 100644 --- a/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp +++ b/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp @@ -3,6 +3,7 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include #include static ur_image_desc_t image_desc{ @@ -65,6 +66,7 @@ std::vector all_image_formats; struct urMemImageCreateTestWithImageFormatParam : uur::urContextTestWithParam { void SetUp() { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA Emulation Device"}); UUR_RETURN_ON_FATAL_FAILURE( uur::urContextTestWithParam::SetUp()); } @@ -83,17 +85,25 @@ struct urMemImageCreateTestWithImageFormatParam } }; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urMemImageCreateTestWithImageFormatParam, ::testing::ValuesIn( urMemImageCreateTestWithImageFormatParam::makeImageFormats()), uur::deviceTestWithParamPrinter); TEST_P(urMemImageCreateTestWithImageFormatParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) UHD Graphics 770"}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_image_channel_order_t channel_order = std::get<1>(GetParam()).channelOrder; ur_image_channel_type_t channel_type = std::get<1>(GetParam()).channelType; + if (channel_order == UR_IMAGE_CHANNEL_ORDER_RGBA) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + } + ur_image_format_t image_format{channel_order, channel_type}; ur_mem_handle_t image_handle = nullptr; diff --git a/test/conformance/memory/urMemImageCreateWithNativeHandle.cpp b/test/conformance/memory/urMemImageCreateWithNativeHandle.cpp index a881af0752..fd51744ab7 100644 --- a/test/conformance/memory/urMemImageCreateWithNativeHandle.cpp +++ b/test/conformance/memory/urMemImageCreateWithNativeHandle.cpp @@ -4,11 +4,20 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include - -using urMemImageCreateWithNativeHandleTest = uur::urMemImageTest; +#include + +struct urMemImageCreateWithNativeHandleTest : uur::urMemImageTest { + void SetUp() { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(urMemImageTest::SetUp()); + } +}; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemImageCreateWithNativeHandleTest); TEST_P(urMemImageCreateWithNativeHandleTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ur_native_handle_t native_handle = 0; UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( urMemGetNativeHandle(image, device, &native_handle)); diff --git a/test/conformance/memory/urMemImageGetInfo.cpp b/test/conformance/memory/urMemImageGetInfo.cpp index 1a67e42fad..78bc3b7513 100644 --- a/test/conformance/memory/urMemImageGetInfo.cpp +++ b/test/conformance/memory/urMemImageGetInfo.cpp @@ -2,9 +2,17 @@ // Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include +#include -using urMemImageGetInfoTest = uur::urMemImageTestWithParam; +struct urMemImageGetInfoTest : uur::urMemImageTestWithParam { + void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE( + uur::urMemImageTestWithParam::SetUp()); + } +}; static std::unordered_map image_info_size_map = { {UR_IMAGE_INFO_FORMAT, sizeof(ur_image_format_t)}, @@ -16,16 +24,19 @@ static std::unordered_map image_info_size_map = { {UR_IMAGE_INFO_DEPTH, sizeof(size_t)}, }; -UUR_TEST_SUITE_P(urMemImageGetInfoTest, - ::testing::Values(UR_IMAGE_INFO_FORMAT, - UR_IMAGE_INFO_ELEMENT_SIZE, - UR_IMAGE_INFO_ROW_PITCH, - UR_IMAGE_INFO_SLICE_PITCH, - UR_IMAGE_INFO_WIDTH, UR_IMAGE_INFO_HEIGHT, - UR_IMAGE_INFO_DEPTH), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urMemImageGetInfoTest, + ::testing::Values(UR_IMAGE_INFO_FORMAT, UR_IMAGE_INFO_ELEMENT_SIZE, + UR_IMAGE_INFO_ROW_PITCH, UR_IMAGE_INFO_SLICE_PITCH, + UR_IMAGE_INFO_WIDTH, UR_IMAGE_INFO_HEIGHT, + UR_IMAGE_INFO_DEPTH), + uur::deviceTestWithParamPrinter); TEST_P(urMemImageGetInfoTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + // This fail is specific to the "Multi device testing" ci job. + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ur_image_info_t info = getParam(); size_t size = 0; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -66,6 +77,9 @@ TEST_P(urMemImageGetInfoTest, InvalidSizeZero) { } TEST_P(urMemImageGetInfoTest, InvalidSizeSmall) { + // This fail is specific to the "Multi device testing" ci job. + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + int info_size = 0; ASSERT_EQ_RESULT(urMemImageGetInfo(image, UR_IMAGE_INFO_FORMAT, sizeof(info_size) - 1, &info_size, diff --git a/test/conformance/memory/urMemRelease.cpp b/test/conformance/memory/urMemRelease.cpp index 730b6aa854..3493d502c5 100644 --- a/test/conformance/memory/urMemRelease.cpp +++ b/test/conformance/memory/urMemRelease.cpp @@ -2,12 +2,16 @@ // Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include "uur/known_failure.h" #include +#include using urMemReleaseTest = uur::urMemBufferTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemReleaseTest); TEST_P(urMemReleaseTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_SUCCESS(urMemRetain(buffer)); ASSERT_SUCCESS(urMemRelease(buffer)); } @@ -18,6 +22,8 @@ TEST_P(urMemReleaseTest, InvalidNullHandleMem) { } TEST_P(urMemReleaseTest, CheckReferenceCount) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + uint32_t referenceCount = 0; ASSERT_SUCCESS(urMemGetInfo(buffer, UR_MEM_INFO_REFERENCE_COUNT, sizeof(referenceCount), &referenceCount, diff --git a/test/conformance/memory/urMemRetain.cpp b/test/conformance/memory/urMemRetain.cpp index a58896a91b..37e5350001 100644 --- a/test/conformance/memory/urMemRetain.cpp +++ b/test/conformance/memory/urMemRetain.cpp @@ -3,11 +3,14 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urMemRetainTest = uur::urMemBufferTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemRetainTest); TEST_P(urMemRetainTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_SUCCESS(urMemRetain(buffer)); ASSERT_SUCCESS(urMemRelease(buffer)); } @@ -17,6 +20,8 @@ TEST_P(urMemRetainTest, InvalidNullHandleMem) { } TEST_P(urMemRetainTest, CheckReferenceCount) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + uint32_t referenceCount = 0; ASSERT_SUCCESS(urMemGetInfo(buffer, UR_MEM_INFO_REFERENCE_COUNT, sizeof(referenceCount), &referenceCount, diff --git a/test/conformance/platform/CMakeLists.txt b/test/conformance/platform/CMakeLists.txt index eec1e9bee3..e07689324b 100644 --- a/test/conformance/platform/CMakeLists.txt +++ b/test/conformance/platform/CMakeLists.txt @@ -3,7 +3,7 @@ # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -add_conformance_test(platform +add_conformance_test_with_platform_environment(platform urPlatformCreateWithNativeHandle.cpp urPlatformGet.cpp urPlatformGetApiVersion.cpp diff --git a/test/conformance/platform/fixtures.h b/test/conformance/platform/fixtures.h deleted file mode 100644 index a11426b25c..0000000000 --- a/test/conformance/platform/fixtures.h +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (C) 2022-2023 Intel Corporation -// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. -// See LICENSE.TXT -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -#ifndef UR_CONFORMANCE_PLATFORM_FIXTURES_H_INCLUDED -#define UR_CONFORMANCE_PLATFORM_FIXTURES_H_INCLUDED - -#include -namespace uur { -namespace platform { - -struct urTest : ::testing::Test { - - void SetUp() override { - ur_device_init_flags_t device_flags = 0; - ASSERT_SUCCESS(urLoaderConfigCreate(&loader_config)); - ASSERT_SUCCESS(urLoaderConfigEnableLayer(loader_config, - "UR_LAYER_FULL_VALIDATION")); - ASSERT_SUCCESS(urLoaderInit(device_flags, loader_config)); - - uint32_t adapter_count; - ASSERT_SUCCESS(urAdapterGet(0, nullptr, &adapter_count)); - adapters.resize(adapter_count); - ASSERT_SUCCESS(urAdapterGet(adapter_count, adapters.data(), nullptr)); - } - - void TearDown() override { - for (auto adapter : adapters) { - ASSERT_SUCCESS(urAdapterRelease(adapter)); - } - if (loader_config) { - ASSERT_SUCCESS(urLoaderConfigRelease(loader_config)); - } - ASSERT_SUCCESS(urLoaderTearDown()); - } - - ur_loader_config_handle_t loader_config = nullptr; - std::vector adapters; -}; - -struct urPlatformsTest : urTest { - - void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urTest::SetUp()); - uint32_t count; - ASSERT_SUCCESS(urPlatformGet(adapters.data(), - static_cast(adapters.size()), 0, - nullptr, &count)); - ASSERT_NE(count, 0); - platforms.resize(count); - ASSERT_SUCCESS(urPlatformGet(adapters.data(), - static_cast(adapters.size()), - count, platforms.data(), nullptr)); - } - - std::vector platforms; -}; - -struct urPlatformTest : urPlatformsTest { - - void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urPlatformsTest::SetUp()); - ASSERT_GE(platforms.size(), 1); - platform = platforms[0]; // TODO - which to choose? - } - - ur_platform_handle_t platform; -}; - -#define UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(FIXTURE) \ - INSTANTIATE_TEST_SUITE_P( \ - , FIXTURE, \ - ::testing::ValuesIn(uur::DevicesEnvironment::instance->devices), \ - [](const ::testing::TestParamInfo &info) { \ - return uur::GetPlatformAndDeviceName(info.param); \ - }) - -} // namespace platform -} // namespace uur - -#endif // UR_CONFORMANCE_PLATFORM_FIXTURES_H_INCLUDED diff --git a/test/conformance/platform/urPlatformCreateWithNativeHandle.cpp b/test/conformance/platform/urPlatformCreateWithNativeHandle.cpp index 6b56f9b661..763c6efcac 100644 --- a/test/conformance/platform/urPlatformCreateWithNativeHandle.cpp +++ b/test/conformance/platform/urPlatformCreateWithNativeHandle.cpp @@ -3,87 +3,88 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "fixtures.h" +#include -using urPlatformCreateWithNativeHandleTest = uur::platform::urPlatformTest; +struct urPlatformCreateWithNativeHandleTest : uur::urPlatformTest { + void SetUp() override { + UUR_RETURN_ON_FATAL_FAILURE(uur::urPlatformTest::SetUp()); + ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_ADAPTER, + sizeof(ur_adapter_handle_t), &adapter, + nullptr)); + } + ur_adapter_handle_t adapter = nullptr; +}; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urPlatformCreateWithNativeHandleTest); -TEST_F(urPlatformCreateWithNativeHandleTest, Success) { - for (auto platform : platforms) { - ur_native_handle_t native_handle = 0; +TEST_P(urPlatformCreateWithNativeHandleTest, Success) { + ur_native_handle_t native_handle = 0; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( - urPlatformGetNativeHandle(platform, &native_handle)); + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urPlatformGetNativeHandle(platform, &native_handle)); - // We cannot assume anything about a native_handle, not even if it's - // `nullptr` since this could be a valid representation within a backend. - // We can however convert the native_handle back into a unified-runtime - // handle and perform some query on it to verify that it works. - ur_platform_handle_t plat = nullptr; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urPlatformCreateWithNativeHandle( - native_handle, adapters[0], nullptr, &plat)); - ASSERT_NE(plat, nullptr); + // We cannot assume anything about a native_handle, not even if it's + // `nullptr` since this could be a valid representation within a backend. + // We can however convert the native_handle back into a unified-runtime + // handle and perform some query on it to verify that it works. + ur_platform_handle_t plat = nullptr; + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urPlatformCreateWithNativeHandle( + native_handle, adapter, nullptr, &plat)); + ASSERT_NE(plat, nullptr); - std::string input_platform_name = uur::GetPlatformName(platform); - std::string created_platform_name = uur::GetPlatformName(plat); - ASSERT_EQ(input_platform_name, created_platform_name); - } + std::string input_platform_name = uur::GetPlatformName(platform); + std::string created_platform_name = uur::GetPlatformName(plat); + ASSERT_EQ(input_platform_name, created_platform_name); } -TEST_F(urPlatformCreateWithNativeHandleTest, SuccessWithOwnedNativeHandle) { - for (auto platform : platforms) { - ur_native_handle_t native_handle = 0; +TEST_P(urPlatformCreateWithNativeHandleTest, SuccessWithOwnedNativeHandle) { + ur_native_handle_t native_handle = 0; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( - urPlatformGetNativeHandle(platform, &native_handle)); + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urPlatformGetNativeHandle(platform, &native_handle)); - // We cannot assume anything about a native_handle, not even if it's - // `nullptr` since this could be a valid representation within a backend. - // We can however convert the native_handle back into a unified-runtime - // handle and perform some query on it to verify that it works. - ur_platform_native_properties_t props = { - UR_STRUCTURE_TYPE_PLATFORM_NATIVE_PROPERTIES, nullptr, true}; - ur_platform_handle_t plat = nullptr; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urPlatformCreateWithNativeHandle( - native_handle, adapters[0], &props, &plat)); - ASSERT_NE(plat, nullptr); + // We cannot assume anything about a native_handle, not even if it's + // `nullptr` since this could be a valid representation within a backend. + // We can however convert the native_handle back into a unified-runtime + // handle and perform some query on it to verify that it works. + ur_platform_native_properties_t props = { + UR_STRUCTURE_TYPE_PLATFORM_NATIVE_PROPERTIES, nullptr, true}; + ur_platform_handle_t plat = nullptr; + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urPlatformCreateWithNativeHandle( + native_handle, adapter, &props, &plat)); + ASSERT_NE(plat, nullptr); - std::string input_platform_name = uur::GetPlatformName(platform); - std::string created_platform_name = uur::GetPlatformName(plat); - ASSERT_EQ(input_platform_name, created_platform_name); - } + std::string input_platform_name = uur::GetPlatformName(platform); + std::string created_platform_name = uur::GetPlatformName(plat); + ASSERT_EQ(input_platform_name, created_platform_name); } -TEST_F(urPlatformCreateWithNativeHandleTest, SuccessWithUnOwnedNativeHandle) { - for (auto platform : platforms) { - ur_native_handle_t native_handle = 0; +TEST_P(urPlatformCreateWithNativeHandleTest, SuccessWithUnOwnedNativeHandle) { + ur_native_handle_t native_handle = 0; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( - urPlatformGetNativeHandle(platform, &native_handle)); + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urPlatformGetNativeHandle(platform, &native_handle)); - // We cannot assume anything about a native_handle, not even if it's - // `nullptr` since this could be a valid representation within a backend. - // We can however convert the native_handle back into a unified-runtime - // handle and perform some query on it to verify that it works. - ur_platform_native_properties_t props = { - UR_STRUCTURE_TYPE_PLATFORM_NATIVE_PROPERTIES, nullptr, false}; - ur_platform_handle_t plat = nullptr; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urPlatformCreateWithNativeHandle( - native_handle, adapters[0], &props, &plat)); - ASSERT_NE(plat, nullptr); + // We cannot assume anything about a native_handle, not even if it's + // `nullptr` since this could be a valid representation within a backend. + // We can however convert the native_handle back into a unified-runtime + // handle and perform some query on it to verify that it works. + ur_platform_native_properties_t props = { + UR_STRUCTURE_TYPE_PLATFORM_NATIVE_PROPERTIES, nullptr, false}; + ur_platform_handle_t plat = nullptr; + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urPlatformCreateWithNativeHandle( + native_handle, adapter, &props, &plat)); + ASSERT_NE(plat, nullptr); - std::string input_platform_name = uur::GetPlatformName(platform); - std::string created_platform_name = uur::GetPlatformName(plat); - ASSERT_EQ(input_platform_name, created_platform_name); - } + std::string input_platform_name = uur::GetPlatformName(platform); + std::string created_platform_name = uur::GetPlatformName(plat); + ASSERT_EQ(input_platform_name, created_platform_name); } -TEST_F(urPlatformCreateWithNativeHandleTest, InvalidNullPointerPlatform) { - for (auto platform : platforms) { - ur_native_handle_t native_handle = 0; - UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( - urPlatformGetNativeHandle(platform, &native_handle)); - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, - urPlatformCreateWithNativeHandle( - native_handle, adapters[0], nullptr, nullptr)); - } +TEST_P(urPlatformCreateWithNativeHandleTest, InvalidNullPointerPlatform) { + ur_native_handle_t native_handle = 0; + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urPlatformGetNativeHandle(platform, &native_handle)); + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, + urPlatformCreateWithNativeHandle(native_handle, adapter, + nullptr, nullptr)); } diff --git a/test/conformance/platform/urPlatformGet.cpp b/test/conformance/platform/urPlatformGet.cpp index 20f12c16df..b7305a066d 100644 --- a/test/conformance/platform/urPlatformGet.cpp +++ b/test/conformance/platform/urPlatformGet.cpp @@ -3,9 +3,12 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "fixtures.h" +#include -using urPlatformGetTest = uur::platform::urTest; +struct urPlatformGetTest : ::testing::Test { + std::vector &adapters = + uur::PlatformEnvironment::instance->adapters; +}; TEST_F(urPlatformGetTest, Success) { uint32_t count; diff --git a/test/conformance/platform/urPlatformGetApiVersion.cpp b/test/conformance/platform/urPlatformGetApiVersion.cpp index 10279d560a..f3571f9a58 100644 --- a/test/conformance/platform/urPlatformGetApiVersion.cpp +++ b/test/conformance/platform/urPlatformGetApiVersion.cpp @@ -3,24 +3,25 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "fixtures.h" +#include -using urPlatformGetApiVersionTest = uur::platform::urPlatformTest; +using urPlatformGetApiVersionTest = uur::urPlatformTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urPlatformGetApiVersionTest); -TEST_F(urPlatformGetApiVersionTest, Success) { +TEST_P(urPlatformGetApiVersionTest, Success) { ur_api_version_t version; ASSERT_EQ_RESULT(UR_RESULT_SUCCESS, urPlatformGetApiVersion(platform, &version)); ASSERT_GE(UR_API_VERSION_CURRENT, version); } -TEST_F(urPlatformGetApiVersionTest, InvalidPlatform) { +TEST_P(urPlatformGetApiVersionTest, InvalidPlatform) { ur_api_version_t version; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, urPlatformGetApiVersion(nullptr, &version)); } -TEST_F(urPlatformGetApiVersionTest, InvalidVersionPtr) { +TEST_P(urPlatformGetApiVersionTest, InvalidVersionPtr) { ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, urPlatformGetApiVersion(platform, nullptr)); } diff --git a/test/conformance/platform/urPlatformGetBackendOption.cpp b/test/conformance/platform/urPlatformGetBackendOption.cpp index 06ac618580..a3ff1963a6 100644 --- a/test/conformance/platform/urPlatformGetBackendOption.cpp +++ b/test/conformance/platform/urPlatformGetBackendOption.cpp @@ -2,47 +2,48 @@ // Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "fixtures.h" -struct urPlatfromGetBackendOptionTestWithParam - : uur::platform::urPlatformTest, - ::testing::WithParamInterface {}; +#include -INSTANTIATE_TEST_SUITE_P(, urPlatfromGetBackendOptionTestWithParam, - ::testing::Values("-O0", "-O1", "-O2", "-O3"), - [](const ::testing::TestParamInfo &info) { - return uur::GTestSanitizeString(info.param); - }); +using urPlatformGetBackendOptionTest = + uur::urPlatformTestWithParam; -TEST_P(urPlatfromGetBackendOptionTestWithParam, Success) { +UUR_PLATFORM_TEST_SUITE_P(urPlatformGetBackendOptionTest, + ::testing::Values("-O0", "-O1", "-O2", "-O3"), + uur::platformTestWithParamPrinter); + +TEST_P(urPlatformGetBackendOptionTest, Success) { const char *platformOption = nullptr; - ASSERT_SUCCESS(urPlatformGetBackendOption(platform, GetParam().c_str(), + ASSERT_SUCCESS(urPlatformGetBackendOption(platform, getParam().c_str(), &platformOption)); ASSERT_NE(platformOption, nullptr); } -using urPlatfromGetBackendOptionTest = uur::platform::urPlatformTest; +using urPlatformGetBackendOptionNegativeTest = uur::urPlatformTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urPlatformGetBackendOptionNegativeTest); -TEST_F(urPlatfromGetBackendOptionTest, InvalidNullHandle) { +TEST_P(urPlatformGetBackendOptionNegativeTest, InvalidNullHandle) { const char *platformOption = nullptr; ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_NULL_HANDLE, urPlatformGetBackendOption(nullptr, "-O0", &platformOption)); } -TEST_F(urPlatfromGetBackendOptionTest, InvalidNullPointerFrontendOption) { +TEST_P(urPlatformGetBackendOptionNegativeTest, + InvalidNullPointerFrontendOption) { const char *platformOption = nullptr; ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_NULL_POINTER, urPlatformGetBackendOption(platform, nullptr, &platformOption)); } -TEST_F(urPlatfromGetBackendOptionTest, InvalidNullPointerPlatformOption) { +TEST_P(urPlatformGetBackendOptionNegativeTest, + InvalidNullPointerPlatformOption) { ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, urPlatformGetBackendOption(platform, "-O0", nullptr)); } -TEST_F(urPlatfromGetBackendOptionTest, InvalidValueFrontendOption) { +TEST_P(urPlatformGetBackendOptionNegativeTest, InvalidValueFrontendOption) { const char *platformOption = nullptr; ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_VALUE, diff --git a/test/conformance/platform/urPlatformGetInfo.cpp b/test/conformance/platform/urPlatformGetInfo.cpp index 8535b42b5b..bf42108b8e 100644 --- a/test/conformance/platform/urPlatformGetInfo.cpp +++ b/test/conformance/platform/urPlatformGetInfo.cpp @@ -3,33 +3,24 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "fixtures.h" +#include "uur/environment.h" #include +#include -struct urPlatformGetInfoTest - : uur::platform::urPlatformTest, - ::testing::WithParamInterface { +using urPlatformGetInfoTest = uur::urPlatformTestWithParam; - void SetUp() { - UUR_RETURN_ON_FATAL_FAILURE(uur::platform::urPlatformTest::SetUp()); - } -}; - -INSTANTIATE_TEST_SUITE_P( - urPlatformGetInfo, urPlatformGetInfoTest, +UUR_PLATFORM_TEST_SUITE_P( + urPlatformGetInfoTest, ::testing::Values(UR_PLATFORM_INFO_NAME, UR_PLATFORM_INFO_VENDOR_NAME, UR_PLATFORM_INFO_VERSION, UR_PLATFORM_INFO_EXTENSIONS, UR_PLATFORM_INFO_PROFILE, UR_PLATFORM_INFO_BACKEND, UR_PLATFORM_INFO_ADAPTER), - [](const ::testing::TestParamInfo &info) { - std::stringstream ss; - ss << info.param; - return ss.str(); - }); + + uur::platformTestWithParamPrinter); TEST_P(urPlatformGetInfoTest, Success) { size_t size = 0; - ur_platform_info_t info_type = GetParam(); + ur_platform_info_t info_type = getParam(); ASSERT_SUCCESS_OR_OPTIONAL_QUERY( urPlatformGetInfo(platform, info_type, 0, nullptr, &size), info_type); if (info_type == UR_PLATFORM_INFO_BACKEND) { @@ -57,8 +48,11 @@ TEST_P(urPlatformGetInfoTest, Success) { auto queried_adapter = *reinterpret_cast(name.data()); auto adapter_found = - std::find(adapters.begin(), adapters.end(), queried_adapter); - ASSERT_NE(adapter_found, adapters.end()); + std::find(uur::PlatformEnvironment::instance->adapters.begin(), + uur::PlatformEnvironment::instance->adapters.end(), + queried_adapter); + ASSERT_NE(adapter_found, + uur::AdapterEnvironment::instance->adapters.end()); break; } default: @@ -69,38 +63,41 @@ TEST_P(urPlatformGetInfoTest, Success) { TEST_P(urPlatformGetInfoTest, InvalidNullHandlePlatform) { size_t size = 0; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, - urPlatformGetInfo(nullptr, GetParam(), 0, nullptr, &size)); + urPlatformGetInfo(nullptr, getParam(), 0, nullptr, &size)); } -TEST_F(urPlatformGetInfoTest, InvalidEnumerationPlatformInfoType) { +using urPlatformGetInfoNegativeTest = uur::urPlatformTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urPlatformGetInfoNegativeTest); + +TEST_P(urPlatformGetInfoNegativeTest, InvalidEnumerationPlatformInfoType) { size_t size = 0; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_ENUMERATION, urPlatformGetInfo(platform, UR_PLATFORM_INFO_FORCE_UINT32, 0, nullptr, &size)); } -TEST_F(urPlatformGetInfoTest, InvalidSizeZero) { +TEST_P(urPlatformGetInfoNegativeTest, InvalidSizeZero) { ur_platform_backend_t backend; ASSERT_EQ_RESULT(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, 0, &backend, nullptr), UR_RESULT_ERROR_INVALID_SIZE); } -TEST_F(urPlatformGetInfoTest, InvalidSizeSmall) { +TEST_P(urPlatformGetInfoNegativeTest, InvalidSizeSmall) { ur_platform_backend_t backend; ASSERT_EQ_RESULT(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, sizeof(backend) - 1, &backend, nullptr), UR_RESULT_ERROR_INVALID_SIZE); } -TEST_F(urPlatformGetInfoTest, InvalidNullPointerPropValue) { +TEST_P(urPlatformGetInfoNegativeTest, InvalidNullPointerPropValue) { ur_platform_backend_t backend; ASSERT_EQ_RESULT(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, sizeof(backend), nullptr, nullptr), UR_RESULT_ERROR_INVALID_NULL_POINTER); } -TEST_F(urPlatformGetInfoTest, InvalidNullPointerPropSizeRet) { +TEST_P(urPlatformGetInfoNegativeTest, InvalidNullPointerPropSizeRet) { ASSERT_EQ_RESULT(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, 0, nullptr, nullptr), UR_RESULT_ERROR_INVALID_NULL_POINTER); diff --git a/test/conformance/platform/urPlatformGetNativeHandle.cpp b/test/conformance/platform/urPlatformGetNativeHandle.cpp index 305eed5eda..ba4e29986f 100644 --- a/test/conformance/platform/urPlatformGetNativeHandle.cpp +++ b/test/conformance/platform/urPlatformGetNativeHandle.cpp @@ -3,28 +3,25 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "fixtures.h" +#include -using urPlatformGetNativeHandleTest = uur::platform::urPlatformsTest; +using urPlatformGetNativeHandleTest = uur::urPlatformTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urPlatformGetNativeHandleTest); -TEST_F(urPlatformGetNativeHandleTest, Success) { - for (auto platform : platforms) { - ur_native_handle_t native_handle = 0; - if (auto error = urPlatformGetNativeHandle(platform, &native_handle)) { - ASSERT_EQ(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, error); - } +TEST_P(urPlatformGetNativeHandleTest, Success) { + ur_native_handle_t native_handle = 0; + if (auto error = urPlatformGetNativeHandle(platform, &native_handle)) { + ASSERT_EQ(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, error); } } -TEST_F(urPlatformGetNativeHandleTest, InvalidNullHandlePlatform) { +TEST_P(urPlatformGetNativeHandleTest, InvalidNullHandlePlatform) { ur_native_handle_t native_handle = 0; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, urPlatformGetNativeHandle(nullptr, &native_handle)); } -TEST_F(urPlatformGetNativeHandleTest, InvalidNullPointerNativePlatform) { - for (auto platform : platforms) { - ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, - urPlatformGetNativeHandle(platform, nullptr)); - } +TEST_P(urPlatformGetNativeHandleTest, InvalidNullPointerNativePlatform) { + ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, + urPlatformGetNativeHandle(platform, nullptr)); } diff --git a/test/conformance/program/program_adapter_cuda.match b/test/conformance/program/program_adapter_cuda.match deleted file mode 100644 index 11bf1c3e67..0000000000 --- a/test/conformance/program/program_adapter_cuda.match +++ /dev/null @@ -1,13 +0,0 @@ -urProgramBuildTest.BuildFailure/* -{{OPT}}urProgramCreateWithILTest.Success/* -{{OPT}}urProgramCreateWithILTest.SuccessWithProperties/* -{{OPT}}urProgramCreateWithILTest.BuildInvalidProgram/* -# This test flakily fails -{{OPT}}urProgramGetBuildInfoSingleTest.LogIsNullTerminated/* -{{OPT}}urProgramSetSpecializationConstantsTest.Success/* -{{OPT}}urProgramSetSpecializationConstantsTest.UseDefaultValue/* -urProgramSetSpecializationConstantsTest.InvalidValueSize/* -urProgramSetSpecializationConstantsTest.InvalidValueId/* -urProgramSetSpecializationConstantsTest.InvalidValuePtr/* -urProgramSetMultipleSpecializationConstantsTest.MultipleCalls/* -urProgramSetMultipleSpecializationConstantsTest.SingleCall/* diff --git a/test/conformance/program/program_adapter_hip.match b/test/conformance/program/program_adapter_hip.match deleted file mode 100644 index 2bf556541d..0000000000 --- a/test/conformance/program/program_adapter_hip.match +++ /dev/null @@ -1,15 +0,0 @@ -urProgramBuildTest.BuildFailure/* -# HIP hasn't implemented urProgramCreateWithNativeHandleTest -{{OPT}}urProgramCreateWithNativeHandleTest.Success/* - -# HIP hasn't implemented urProgramLink -{{OPT}}urProgramLinkTest.Success/* - -# Hip doesn't support specialization constants -urProgramSetSpecializationConstantsTest.Success/* -urProgramSetSpecializationConstantsTest.UseDefaultValue/* -urProgramSetSpecializationConstantsTest.InvalidValueSize/* -urProgramSetSpecializationConstantsTest.InvalidValueId/* -urProgramSetSpecializationConstantsTest.InvalidValuePtr/* -urProgramSetMultipleSpecializationConstantsTest.MultipleCalls/* -urProgramSetMultipleSpecializationConstantsTest.SingleCall/* diff --git a/test/conformance/program/program_adapter_level_zero.match b/test/conformance/program/program_adapter_level_zero.match deleted file mode 100644 index 8cb53734bd..0000000000 --- a/test/conformance/program/program_adapter_level_zero.match +++ /dev/null @@ -1,4 +0,0 @@ -urProgramSetSpecializationConstantsTest.InvalidValueSize/* -urProgramSetSpecializationConstantsTest.InvalidValueId/* -urProgramSetSpecializationConstantsTest.InvalidValuePtr/* -urProgramGetBuildInfoTest.Success/*UR_PROGRAM_BUILD_INFO_STATUS diff --git a/test/conformance/program/program_adapter_level_zero_v2.match b/test/conformance/program/program_adapter_level_zero_v2.match deleted file mode 100644 index 920d5f1b5b..0000000000 --- a/test/conformance/program/program_adapter_level_zero_v2.match +++ /dev/null @@ -1,5 +0,0 @@ -urProgramSetSpecializationConstantsTest.InvalidValueSize/* -urProgramSetSpecializationConstantsTest.InvalidValueId/* -urProgramSetSpecializationConstantsTest.InvalidValuePtr/* -urProgramGetBuildInfoTest.Success/*UR_PROGRAM_BUILD_INFO_STATUS -{{OPT}}urMultiDeviceCommandBufferExpTest.* diff --git a/test/conformance/program/program_adapter_native_cpu.match b/test/conformance/program/program_adapter_native_cpu.match deleted file mode 100644 index bd04ab9e8c..0000000000 --- a/test/conformance/program/program_adapter_native_cpu.match +++ /dev/null @@ -1,79 +0,0 @@ -{{OPT}}urProgramBuildTest.Success/* -{{OPT}}urProgramBuildTest.SuccessWithOptions/* -{{OPT}}urProgramBuildTest.InvalidNullHandleContext/* -{{OPT}}urProgramBuildTest.InvalidNullHandleProgram/* -{{OPT}}urProgramBuildTest.BuildFailure/* -{{OPT}}urProgramCompileTest.Success/* -{{OPT}}urProgramCompileTest.InvalidNullHandleContext/* -{{OPT}}urProgramCompileTest.InvalidNullHandleProgram/* -{{OPT}}urProgramCreateWithBinaryTest.Success/* -{{OPT}}urProgramCreateWithBinaryTest.InvalidNullHandleContext/* -{{OPT}}urProgramCreateWithBinaryTest.InvalidNullHandleDevice/* -{{OPT}}urProgramCreateWithBinaryTest.InvalidNullPointerBinary/* -{{OPT}}urProgramCreateWithBinaryTest.InvalidNullPointerProgram/* -{{OPT}}urProgramCreateWithBinaryTest.InvalidNullPointerMetadata/* -{{OPT}}urProgramCreateWithBinaryTest.InvalidSizePropertyCount/* -{{OPT}}urProgramCreateWithBinaryTest.BuildInvalidProgramBinary/* -{{OPT}}urProgramCreateWithILTest.Success/* -{{OPT}}urProgramCreateWithILTest.SuccessWithProperties/* -{{OPT}}urProgramCreateWithILTest.InvalidNullHandle/* -{{OPT}}urProgramCreateWithILTest.InvalidNullPointerSource/* -{{OPT}}urProgramCreateWithILTest.InvalidSizeLength/* -{{OPT}}urProgramCreateWithILTest.InvalidNullPointerProgram/* -{{OPT}}urProgramCreateWithILTest.BuildInvalidProgram/* -{{OPT}}urProgramCreateWithNativeHandleTest.Success/* -{{OPT}}urProgramCreateWithNativeHandleTest.InvalidNullHandleContext/* -{{OPT}}urProgramCreateWithNativeHandleTest.InvalidNullPointerProgram/* -{{OPT}}urProgramGetBuildInfoTest.Success/* -{{OPT}}urProgramGetBuildInfoTest.InvalidNullHandleProgram/* -{{OPT}}urProgramGetBuildInfoTest.InvalidNullHandleDevice/* -{{OPT}}urProgramGetBuildInfoTest.InvalidEnumeration/* -{{OPT}}urProgramGetBuildInfoSingleTest.LogIsNullTerminated/* -{{OPT}}urProgramGetFunctionPointerTest.Success/* -{{OPT}}urProgramGetFunctionPointerTest.InvalidKernelName/* -{{OPT}}urProgramGetFunctionPointerTest.InvalidNullHandleDevice/* -{{OPT}}urProgramGetFunctionPointerTest.InvalidNullHandleProgram/* -{{OPT}}urProgramGetFunctionPointerTest.InvalidNullPointerFunctionName/* -{{OPT}}urProgramGetFunctionPointerTest.InvalidNullPointerFunctionPointer/* -{{OPT}}urProgramGetGlobalVariablePointerTest.Success/* -{{OPT}}urProgramGetGlobalVariablePointerTest.InvalidNullHandleDevice/* -{{OPT}}urProgramGetGlobalVariablePointerTest.InvalidNullHandleProgram/* -{{OPT}}urProgramGetGlobalVariablePointerTest.InvalidVariableName/* -{{OPT}}urProgramGetGlobalVariablePointerTest.InvalidNullPointerVariableName/* -{{OPT}}urProgramGetGlobalVariablePointerTest.InvalidNullPointerVariablePointer/* -{{OPT}}urProgramGetGlobalVariablePointerTest.InvalidProgramExecutable/* -{{OPT}}urProgramGetInfoTest.Success/* -{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/* -{{OPT}}urProgramGetInfoTest.InvalidEnumeration/* -{{OPT}}urProgramGetInfoTest.InvalidSizeZero/* -{{OPT}}urProgramGetInfoTest.InvalidSizeSmall/* -{{OPT}}urProgramGetInfoTest.InvalidNullPointerPropValue/* -{{OPT}}urProgramGetInfoTest.InvalidNullPointerPropValueRet/* -{{OPT}}urProgramGetInfoSingleTest.NumDevicesIsNonzero/* -{{OPT}}urProgramGetInfoSingleTest.NumDevicesMatchesDeviceArray/* -{{OPT}}urProgramGetInfoSingleTest.NumDevicesMatchesContextNumDevices/* -{{OPT}}urProgramGetNativeHandleTest.Success/* -{{OPT}}urProgramGetNativeHandleTest.InvalidNullHandleProgram/* -{{OPT}}urProgramGetNativeHandleTest.InvalidNullPointerNativeProgram/* -{{OPT}}urProgramLinkTest.Success/* -{{OPT}}urProgramLinkTest.InvalidNullHandleContext/* -{{OPT}}urProgramLinkTest.InvalidNullPointerProgram/* -{{OPT}}urProgramLinkTest.InvalidNullPointerInputPrograms/* -{{OPT}}urProgramLinkTest.InvalidSizeCount/* -{{OPT}}urProgramLinkTest.SetOutputOnZeroCount/* -{{OPT}}urProgramLinkErrorTest.LinkFailure/* -{{OPT}}urProgramLinkErrorTest.SetOutputOnLinkError/* -{{OPT}}urProgramReleaseTest.Success/* -{{OPT}}urProgramReleaseTest.InvalidNullHandleProgram/* -{{OPT}}urProgramRetainTest.Success/* -{{OPT}}urProgramRetainTest.InvalidNullHandleProgram/* -{{OPT}}urProgramSetSpecializationConstantsTest.Success/* -{{OPT}}urProgramSetSpecializationConstantsTest.UseDefaultValue/* -{{OPT}}urProgramSetSpecializationConstantsTest.InvalidNullHandleProgram/* -{{OPT}}urProgramSetSpecializationConstantsTest.InvalidNullPointerSpecConstants/* -{{OPT}}urProgramSetSpecializationConstantsTest.InvalidSizeCount/* -{{OPT}}urProgramSetSpecializationConstantsTest.InvalidValueSize/* -{{OPT}}urProgramSetSpecializationConstantsTest.InvalidValueId/* -{{OPT}}urProgramSetSpecializationConstantsTest.InvalidValuePtr/* -{{OPT}}urProgramSetMultipleSpecializationConstantsTest.MultipleCalls/* -{{OPT}}urProgramSetMultipleSpecializationConstantsTest.SingleCall/* diff --git a/test/conformance/program/urMultiDeviceProgramCreateWithBinary.cpp b/test/conformance/program/urMultiDeviceProgramCreateWithBinary.cpp index 5f99747462..25ffec4edc 100644 --- a/test/conformance/program/urMultiDeviceProgramCreateWithBinary.cpp +++ b/test/conformance/program/urMultiDeviceProgramCreateWithBinary.cpp @@ -51,9 +51,10 @@ struct urMultiDeviceProgramCreateWithBinaryTest std::vector binary_sizes; ur_program_handle_t binary_program = nullptr; }; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMultiDeviceProgramCreateWithBinaryTest); // Create the kernel using the program created with multiple binaries and run it on all devices. -TEST_F(urMultiDeviceProgramCreateWithBinaryTest, +TEST_P(urMultiDeviceProgramCreateWithBinaryTest, CreateAndRunKernelOnAllDevices) { constexpr size_t global_offset = 0; constexpr size_t n_dimensions = 1; @@ -77,7 +78,7 @@ TEST_F(urMultiDeviceProgramCreateWithBinaryTest, } } -TEST_F(urMultiDeviceProgramCreateWithBinaryTest, CheckCompileAndLink) { +TEST_P(urMultiDeviceProgramCreateWithBinaryTest, CheckCompileAndLink) { // TODO: Current behaviour is that we allow to compile only IL programs for Level Zero and link only programs in Object state. // OpenCL allows to compile and link programs created from native binaries, so probably we should align those two. ur_platform_backend_t backend; @@ -100,7 +101,7 @@ TEST_F(urMultiDeviceProgramCreateWithBinaryTest, CheckCompileAndLink) { } } -TEST_F(urMultiDeviceProgramCreateWithBinaryTest, +TEST_P(urMultiDeviceProgramCreateWithBinaryTest, InvalidProgramBinaryForOneOfTheDevices) { std::vector pointers_with_invalid_binary; for (size_t i = 1; i < devices.size(); i++) { @@ -115,7 +116,7 @@ TEST_F(urMultiDeviceProgramCreateWithBinaryTest, } // Test the case when program is built multiple times for different devices from context. -TEST_F(urMultiDeviceProgramCreateWithBinaryTest, MultipleBuildCalls) { +TEST_P(urMultiDeviceProgramCreateWithBinaryTest, MultipleBuildCalls) { // Run test only for level zero backend which supports urProgramBuildExp. ur_platform_backend_t backend; ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, @@ -145,7 +146,7 @@ TEST_F(urMultiDeviceProgramCreateWithBinaryTest, MultipleBuildCalls) { } // Test the case we get native binaries from program created with multiple binaries which wasn't built (i.e. in Native state). -TEST_F(urMultiDeviceProgramCreateWithBinaryTest, +TEST_P(urMultiDeviceProgramCreateWithBinaryTest, GetBinariesAndSizesFromProgramInNativeState) { size_t exp_binary_sizes_len = 0; std::vector exp_binary_sizes; @@ -176,7 +177,7 @@ TEST_F(urMultiDeviceProgramCreateWithBinaryTest, ASSERT_EQ(exp_binary_sizes, binary_sizes); } -TEST_F(urMultiDeviceProgramCreateWithBinaryTest, GetIL) { +TEST_P(urMultiDeviceProgramCreateWithBinaryTest, GetIL) { size_t il_length = 0; ASSERT_SUCCESS(urProgramGetInfo(binary_program, UR_PROGRAM_INFO_IL, 0, nullptr, &il_length)); @@ -187,7 +188,7 @@ TEST_F(urMultiDeviceProgramCreateWithBinaryTest, GetIL) { UR_RESULT_ERROR_INVALID_NULL_POINTER); } -TEST_F(urMultiDeviceProgramCreateWithBinaryTest, CheckProgramGetInfo) { +TEST_P(urMultiDeviceProgramCreateWithBinaryTest, CheckProgramGetInfo) { std::vector property_value; size_t property_size = 0; @@ -297,8 +298,9 @@ struct urMultiDeviceCommandBufferExpTest static constexpr size_t global_size = 64; static constexpr size_t local_size = 4; }; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMultiDeviceCommandBufferExpTest); -TEST_F(urMultiDeviceCommandBufferExpTest, Enqueue) { +TEST_P(urMultiDeviceCommandBufferExpTest, Enqueue) { for (size_t i = 0; i < devices.size(); i++) { auto device = devices[i]; if (!hasCommandBufferSupport(device)) { @@ -324,7 +326,7 @@ TEST_F(urMultiDeviceCommandBufferExpTest, Enqueue) { } } -TEST_F(urMultiDeviceCommandBufferExpTest, Update) { +TEST_P(urMultiDeviceCommandBufferExpTest, Update) { for (size_t i = 0; i < devices.size(); i++) { auto device = devices[i]; if (!(hasCommandBufferSupport(device) && diff --git a/test/conformance/program/urMultiDeviceProgramCreateWithIL.cpp b/test/conformance/program/urMultiDeviceProgramCreateWithIL.cpp index 652de93540..fc7896472f 100644 --- a/test/conformance/program/urMultiDeviceProgramCreateWithIL.cpp +++ b/test/conformance/program/urMultiDeviceProgramCreateWithIL.cpp @@ -8,9 +8,10 @@ #include using urMultiDeviceProgramTest = uur::urMultiDeviceProgramTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urMultiDeviceProgramTest); // Test binary sizes and binaries obtained from urProgramGetInfo when program is built for a subset of devices in the context. -TEST_F(urMultiDeviceProgramTest, urMultiDeviceProgramGetInfo) { +TEST_P(urMultiDeviceProgramTest, urMultiDeviceProgramGetInfo) { // Run test only for level zero backend which supports urProgramBuildExp. ur_platform_backend_t backend; ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, diff --git a/test/conformance/program/urProgramBuild.cpp b/test/conformance/program/urProgramBuild.cpp index a7e7e4a275..659c9af7e8 100644 --- a/test/conformance/program/urProgramBuild.cpp +++ b/test/conformance/program/urProgramBuild.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urProgramBuildTest = uur::urProgramTest; UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramBuildTest); @@ -28,6 +29,9 @@ TEST_P(urProgramBuildTest, InvalidNullHandleProgram) { } TEST_P(urProgramBuildTest, BuildFailure) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + ur_program_handle_t program = nullptr; std::shared_ptr> il_binary; uur::KernelsEnvironment::instance->LoadSource("build_failure", il_binary); diff --git a/test/conformance/program/urProgramCreateWithIL.cpp b/test/conformance/program/urProgramCreateWithIL.cpp index 7c02c3c7b9..6c7b306858 100644 --- a/test/conformance/program/urProgramCreateWithIL.cpp +++ b/test/conformance/program/urProgramCreateWithIL.cpp @@ -4,9 +4,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urProgramCreateWithILTest : uur::urContextTest { void SetUp() override { + // We haven't got device code tests working on native cpu yet. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(urContextTest::SetUp()); // TODO: This should use a query for urProgramCreateWithIL support or // rely on UR_RESULT_ERROR_UNSUPPORTED_FEATURE being returned. @@ -29,6 +33,8 @@ struct urProgramCreateWithILTest : uur::urContextTest { UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramCreateWithILTest); TEST_P(urProgramCreateWithILTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + ur_program_handle_t program = nullptr; ASSERT_SUCCESS(urProgramCreateWithIL(context, il_binary->data(), il_binary->size(), nullptr, &program)); @@ -37,6 +43,8 @@ TEST_P(urProgramCreateWithILTest, Success) { } TEST_P(urProgramCreateWithILTest, SuccessWithProperties) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + ur_program_properties_t properties{UR_STRUCTURE_TYPE_PROGRAM_PROPERTIES, nullptr, 0, nullptr}; ur_program_handle_t program = nullptr; @@ -76,6 +84,8 @@ TEST_P(urProgramCreateWithILTest, InvalidNullPointerProgram) { } TEST_P(urProgramCreateWithILTest, BuildInvalidProgram) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + ur_program_handle_t program = nullptr; char binary[] = {0, 1, 2, 3, 4}; auto result = urProgramCreateWithIL(context, &binary, 5, nullptr, &program); diff --git a/test/conformance/program/urProgramCreateWithNativeHandle.cpp b/test/conformance/program/urProgramCreateWithNativeHandle.cpp index 00493d90a8..a8e914719f 100644 --- a/test/conformance/program/urProgramCreateWithNativeHandle.cpp +++ b/test/conformance/program/urProgramCreateWithNativeHandle.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urProgramCreateWithNativeHandleTest : uur::urProgramTest { void SetUp() override { diff --git a/test/conformance/program/urProgramGetBuildInfo.cpp b/test/conformance/program/urProgramGetBuildInfo.cpp index df46467197..f8ee43e343 100644 --- a/test/conformance/program/urProgramGetBuildInfo.cpp +++ b/test/conformance/program/urProgramGetBuildInfo.cpp @@ -3,6 +3,7 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include "uur/known_failure.h" #include struct urProgramGetBuildInfoTest @@ -14,12 +15,12 @@ struct urProgramGetBuildInfoTest } }; -UUR_TEST_SUITE_P(urProgramGetBuildInfoTest, - ::testing::Values(UR_PROGRAM_BUILD_INFO_STATUS, - UR_PROGRAM_BUILD_INFO_OPTIONS, - UR_PROGRAM_BUILD_INFO_LOG, - UR_PROGRAM_BUILD_INFO_BINARY_TYPE), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urProgramGetBuildInfoTest, + ::testing::Values(UR_PROGRAM_BUILD_INFO_STATUS, + UR_PROGRAM_BUILD_INFO_OPTIONS, UR_PROGRAM_BUILD_INFO_LOG, + UR_PROGRAM_BUILD_INFO_BINARY_TYPE), + uur::deviceTestWithParamPrinter); struct urProgramGetBuildInfoSingleTest : uur::urProgramTest { void SetUp() override { @@ -31,6 +32,12 @@ UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramGetBuildInfoSingleTest); TEST_P(urProgramGetBuildInfoTest, Success) { auto property_name = getParam(); + + if (property_name == UR_PROGRAM_BUILD_INFO_STATUS) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + } + size_t property_size = 0; std::vector property_value; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -72,6 +79,9 @@ TEST_P(urProgramGetBuildInfoTest, InvalidEnumeration) { } TEST_P(urProgramGetBuildInfoSingleTest, LogIsNullTerminated) { + // This is a flaky fail. + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + size_t logSize; std::vector log; diff --git a/test/conformance/program/urProgramGetFunctionPointer.cpp b/test/conformance/program/urProgramGetFunctionPointer.cpp index 41d397d527..a1dd59c8d0 100644 --- a/test/conformance/program/urProgramGetFunctionPointer.cpp +++ b/test/conformance/program/urProgramGetFunctionPointer.cpp @@ -3,6 +3,7 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include "uur/known_failure.h" #include struct urProgramGetFunctionPointerTest : uur::urProgramTest { @@ -20,6 +21,7 @@ struct urProgramGetFunctionPointerTest : uur::urProgramTest { UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramGetFunctionPointerTest); TEST_P(urProgramGetFunctionPointerTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) UHD Graphics 770"}); void *function_pointer = nullptr; ASSERT_SUCCESS(urProgramGetFunctionPointer( device, program, function_name.data(), &function_pointer)); diff --git a/test/conformance/program/urProgramGetInfo.cpp b/test/conformance/program/urProgramGetInfo.cpp index 176a278583..12e361c3f2 100644 --- a/test/conformance/program/urProgramGetInfo.cpp +++ b/test/conformance/program/urProgramGetInfo.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urProgramGetInfoTest : uur::urProgramTestWithParam { void SetUp() override { @@ -14,7 +15,7 @@ struct urProgramGetInfoTest : uur::urProgramTestWithParam { } }; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urProgramGetInfoTest, ::testing::Values(UR_PROGRAM_INFO_REFERENCE_COUNT, UR_PROGRAM_INFO_CONTEXT, UR_PROGRAM_INFO_NUM_DEVICES, UR_PROGRAM_INFO_DEVICES, @@ -33,6 +34,12 @@ UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramGetInfoSingleTest); TEST_P(urProgramGetInfoTest, Success) { auto property_name = getParam(); + + // It isn't possible to implement this on HIP + if (property_name == UR_PROGRAM_INFO_NUM_KERNELS) { + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + } + std::vector property_value; size_t property_size = 0; if (property_name == UR_PROGRAM_INFO_BINARIES) { @@ -89,13 +96,8 @@ TEST_P(urProgramGetInfoTest, Success) { auto returned_devices = reinterpret_cast(property_value.data()); size_t devices_count = property_size / sizeof(ur_device_handle_t); - ASSERT_GT(devices_count, 0); - for (uint32_t i = 0; i < devices_count; i++) { - auto &devices = uur::DevicesEnvironment::instance->devices; - auto queried_device = - std::find(devices.begin(), devices.end(), returned_devices[i]); - EXPECT_TRUE(queried_device != devices.end()); - } + ASSERT_EQ(devices_count, 1); + ASSERT_EQ(returned_devices[0], device); break; } case UR_PROGRAM_INFO_NUM_KERNELS: { diff --git a/test/conformance/program/urProgramLink.cpp b/test/conformance/program/urProgramLink.cpp index e14c38d883..c1462f845b 100644 --- a/test/conformance/program/urProgramLink.cpp +++ b/test/conformance/program/urProgramLink.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urProgramLinkTest : uur::urProgramTest { void SetUp() override { @@ -35,6 +36,9 @@ struct urProgramLinkErrorTest : uur::urQueueTest { const std::string linker_error_program_name = "linker_error"; void SetUp() override { + // We haven't got device code tests working on native cpu yet. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); // TODO: This should use a query for urProgramCreateWithIL support or // rely on UR_RESULT_ERROR_UNSUPPORTED_FEATURE being returned. @@ -72,6 +76,9 @@ struct urProgramLinkErrorTest : uur::urQueueTest { UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramLinkErrorTest); TEST_P(urProgramLinkTest, Success) { + // This entry point isn't implemented for HIP. + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + ASSERT_SUCCESS( urProgramLink(context, 1, &program, nullptr, &linked_program)); ur_program_binary_type_t binary_type = UR_PROGRAM_BINARY_TYPE_NONE; diff --git a/test/conformance/program/urProgramSetSpecializationConstants.cpp b/test/conformance/program/urProgramSetSpecializationConstants.cpp index 949c5c323e..7104c7a0b2 100644 --- a/test/conformance/program/urProgramSetSpecializationConstants.cpp +++ b/test/conformance/program/urProgramSetSpecializationConstants.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urProgramSetSpecializationConstantsTest : uur::urKernelExecutionTest { void SetUp() override { @@ -30,6 +31,9 @@ UUR_INSTANTIATE_KERNEL_TEST_SUITE_P( urProgramSetMultipleSpecializationConstantsTest); TEST_P(urProgramSetSpecializationConstantsTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + ASSERT_SUCCESS(urProgramSetSpecializationConstants(program, 1, &info)); ASSERT_SUCCESS(urProgramBuild(context, program, nullptr)); auto entry_points = @@ -44,6 +48,9 @@ TEST_P(urProgramSetSpecializationConstantsTest, Success) { } TEST_P(urProgramSetSpecializationConstantsTest, UseDefaultValue) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + ur_platform_backend_t backend; ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, sizeof(ur_platform_backend_t), &backend, @@ -67,6 +74,9 @@ TEST_P(urProgramSetSpecializationConstantsTest, UseDefaultValue) { } TEST_P(urProgramSetMultipleSpecializationConstantsTest, MultipleCalls) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + uint32_t a = 100; uint64_t b = 200; bool c = false; @@ -98,6 +108,9 @@ TEST_P(urProgramSetMultipleSpecializationConstantsTest, MultipleCalls) { } TEST_P(urProgramSetMultipleSpecializationConstantsTest, SingleCall) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + uint32_t a = 200; uint64_t b = 300; bool c = true; @@ -143,6 +156,11 @@ TEST_P(urProgramSetSpecializationConstantsTest, InvalidSizeCount) { } TEST_P(urProgramSetSpecializationConstantsTest, InvalidValueSize) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + ur_specialization_constant_info_t bad_info = {0, 0x1000, &spec_value}; ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_VALUE, @@ -150,6 +168,11 @@ TEST_P(urProgramSetSpecializationConstantsTest, InvalidValueSize) { } TEST_P(urProgramSetSpecializationConstantsTest, InvalidValueId) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + ur_specialization_constant_info_t bad_info = {999, sizeof(spec_value), &spec_value}; ASSERT_EQ_RESULT( @@ -158,6 +181,11 @@ TEST_P(urProgramSetSpecializationConstantsTest, InvalidValueId) { } TEST_P(urProgramSetSpecializationConstantsTest, InvalidValuePtr) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + ur_specialization_constant_info_t bad_info = {0, sizeof(spec_value), nullptr}; ASSERT_EQ_RESULT( diff --git a/test/conformance/queue/queue_adapter_native_cpu.match b/test/conformance/queue/queue_adapter_native_cpu.match deleted file mode 100644 index 8bac2b269e..0000000000 --- a/test/conformance/queue/queue_adapter_native_cpu.match +++ /dev/null @@ -1,15 +0,0 @@ -urQueueCreateTest.Success/* -urQueueCreateTest.CheckContext/* -urQueueCreateWithParamTest.SuccessWithProperties/* -urQueueCreateWithParamTest.MatchingDeviceHandles/* -urQueueFlushTest.Success/* -urQueueGetInfoTest.Context/* -urQueueGetInfoTest.Device/* -urQueueGetInfoTest.Flags/* -urQueueGetInfoTest.ReferenceCount/* -urQueueGetInfoTest.InvalidSizeSmall/* -urQueueGetInfoTest.EmptyQueue/* -urQueueGetInfoDeviceQueueTestWithInfoParam.DeviceDefault/* -urQueueGetInfoDeviceQueueTestWithInfoParam.Size/* -urQueueRetainTest.Success/* -urQueueReleaseTest.Success/* diff --git a/test/conformance/queue/urQueueCreate.cpp b/test/conformance/queue/urQueueCreate.cpp index 8b26784ef5..d516384ad9 100644 --- a/test/conformance/queue/urQueueCreate.cpp +++ b/test/conformance/queue/urQueueCreate.cpp @@ -5,11 +5,14 @@ #include "ur_api.h" #include "uur/raii.h" #include +#include using urQueueCreateTest = uur::urContextTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urQueueCreateTest); TEST_P(urQueueCreateTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + uur::raii::Queue queue = nullptr; ASSERT_SUCCESS(urQueueCreate(context, device, nullptr, queue.ptr())); ASSERT_NE(nullptr, queue); @@ -24,22 +27,23 @@ TEST_P(urQueueCreateTest, Success) { } using urQueueCreateWithParamTest = uur::urContextTestWithParam; -UUR_TEST_SUITE_P(urQueueCreateWithParamTest, - testing::Values(UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE, - UR_QUEUE_FLAG_PROFILING_ENABLE, - UR_QUEUE_FLAG_ON_DEVICE, - UR_QUEUE_FLAG_ON_DEVICE_DEFAULT, - UR_QUEUE_FLAG_DISCARD_EVENTS, - UR_QUEUE_FLAG_PRIORITY_LOW, - UR_QUEUE_FLAG_PRIORITY_HIGH, - UR_QUEUE_FLAG_SUBMISSION_BATCHED, - UR_QUEUE_FLAG_SUBMISSION_IMMEDIATE, - UR_QUEUE_FLAG_USE_DEFAULT_STREAM, - UR_QUEUE_FLAG_SYNC_WITH_DEFAULT_STREAM, - UR_QUEUE_FLAG_LOW_POWER_EVENTS_EXP), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urQueueCreateWithParamTest, + testing::Values(UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE, + UR_QUEUE_FLAG_PROFILING_ENABLE, UR_QUEUE_FLAG_ON_DEVICE, + UR_QUEUE_FLAG_ON_DEVICE_DEFAULT, + UR_QUEUE_FLAG_DISCARD_EVENTS, UR_QUEUE_FLAG_PRIORITY_LOW, + UR_QUEUE_FLAG_PRIORITY_HIGH, + UR_QUEUE_FLAG_SUBMISSION_BATCHED, + UR_QUEUE_FLAG_SUBMISSION_IMMEDIATE, + UR_QUEUE_FLAG_USE_DEFAULT_STREAM, + UR_QUEUE_FLAG_SYNC_WITH_DEFAULT_STREAM, + UR_QUEUE_FLAG_LOW_POWER_EVENTS_EXP), + uur::deviceTestWithParamPrinter); TEST_P(urQueueCreateWithParamTest, SuccessWithProperties) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_queue_flags_t supportedFlags{}; ASSERT_SUCCESS(uur::GetDeviceQueueOnHostProperties(device, supportedFlags)); @@ -73,6 +77,8 @@ TEST_P(urQueueCreateWithParamTest, SuccessWithProperties) { /* Creates two queues with the same platform and device, and checks that the * queried device and platform of both queues match. */ TEST_P(urQueueCreateWithParamTest, MatchingDeviceHandles) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_queue_flags_t supportedFlags{}; ASSERT_SUCCESS(uur::GetDeviceQueueOnHostProperties(device, supportedFlags)); @@ -110,6 +116,7 @@ TEST_P(urQueueCreateWithParamTest, MatchingDeviceHandles) { /* Create a queue and check that it returns the right context*/ TEST_P(urQueueCreateTest, CheckContext) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); uur::raii::Queue queue = nullptr; ASSERT_SUCCESS(urQueueCreate(context, device, nullptr, queue.ptr())); @@ -124,9 +131,10 @@ TEST_P(urQueueCreateTest, CheckContext) { } using urQueueCreateTestMultipleDevices = uur::urAllDevicesTest; +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urQueueCreateTestMultipleDevices); /* Create a queue using a context from a different device */ -TEST_F(urQueueCreateTestMultipleDevices, ContextFromWrongDevice) { +TEST_P(urQueueCreateTestMultipleDevices, ContextFromWrongDevice) { if (devices.size() < 2) { GTEST_SKIP() << "Test requires at least 2 devices in the system"; diff --git a/test/conformance/queue/urQueueFlush.cpp b/test/conformance/queue/urQueueFlush.cpp index 997fd33e28..3907d3c020 100644 --- a/test/conformance/queue/urQueueFlush.cpp +++ b/test/conformance/queue/urQueueFlush.cpp @@ -4,12 +4,15 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "uur/fixtures.h" +#include "uur/known_failure.h" #include "uur/raii.h" using urQueueFlushTest = uur::urQueueTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urQueueFlushTest); TEST_P(urQueueFlushTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + constexpr size_t buffer_size = 1024; uur::raii::Mem buffer = nullptr; ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_READ_WRITE, diff --git a/test/conformance/queue/urQueueGetInfo.cpp b/test/conformance/queue/urQueueGetInfo.cpp index 57fdd954d1..8ed536efee 100644 --- a/test/conformance/queue/urQueueGetInfo.cpp +++ b/test/conformance/queue/urQueueGetInfo.cpp @@ -3,11 +3,14 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urQueueGetInfoTest = uur::urQueueTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urQueueGetInfoTest); TEST_P(urQueueGetInfoTest, Context) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; auto infoType = UR_QUEUE_INFO_CONTEXT; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -24,6 +27,8 @@ TEST_P(urQueueGetInfoTest, Context) { } TEST_P(urQueueGetInfoTest, Device) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; auto infoType = UR_QUEUE_INFO_DEVICE; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -39,6 +44,8 @@ TEST_P(urQueueGetInfoTest, Device) { } TEST_P(urQueueGetInfoTest, Flags) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; auto infoType = UR_QUEUE_INFO_FLAGS; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -54,6 +61,8 @@ TEST_P(urQueueGetInfoTest, Flags) { } TEST_P(urQueueGetInfoTest, ReferenceCount) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; auto infoType = UR_QUEUE_INFO_REFERENCE_COUNT; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -69,6 +78,8 @@ TEST_P(urQueueGetInfoTest, ReferenceCount) { } TEST_P(urQueueGetInfoTest, EmptyQueue) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; auto infoType = UR_QUEUE_INFO_EMPTY; ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -107,6 +118,8 @@ TEST_P(urQueueGetInfoTest, InvalidSizeZero) { } TEST_P(urQueueGetInfoTest, InvalidSizeSmall) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_context_handle_t context = nullptr; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urQueueGetInfo(queue, UR_QUEUE_INFO_CONTEXT, @@ -159,6 +172,7 @@ struct urQueueGetInfoDeviceQueueTestWithInfoParam : public uur::urQueueTest { UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urQueueGetInfoDeviceQueueTestWithInfoParam); TEST_P(urQueueGetInfoDeviceQueueTestWithInfoParam, DeviceDefault) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); size_t size = 0; auto infoType = UR_QUEUE_INFO_DEVICE_DEFAULT; @@ -175,6 +189,7 @@ TEST_P(urQueueGetInfoDeviceQueueTestWithInfoParam, DeviceDefault) { } TEST_P(urQueueGetInfoDeviceQueueTestWithInfoParam, Size) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); size_t size = 0; auto infoType = UR_QUEUE_INFO_SIZE; diff --git a/test/conformance/queue/urQueueRelease.cpp b/test/conformance/queue/urQueueRelease.cpp index 8efa29731a..664bd9109e 100644 --- a/test/conformance/queue/urQueueRelease.cpp +++ b/test/conformance/queue/urQueueRelease.cpp @@ -3,11 +3,14 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urQueueReleaseTest = uur::urQueueTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urQueueReleaseTest); TEST_P(urQueueReleaseTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_SUCCESS(urQueueRetain(queue)); uint32_t prevRefCount = 0; diff --git a/test/conformance/queue/urQueueRetain.cpp b/test/conformance/queue/urQueueRetain.cpp index c145fea84e..462b476930 100644 --- a/test/conformance/queue/urQueueRetain.cpp +++ b/test/conformance/queue/urQueueRetain.cpp @@ -3,11 +3,14 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urQueueRetainTest = uur::urQueueTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urQueueRetainTest); TEST_P(urQueueRetainTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + uint32_t prevRefCount = 0; ASSERT_SUCCESS(uur::GetObjectReferenceCount(queue, prevRefCount)); diff --git a/test/conformance/sampler/sampler_adapter_level_zero.match b/test/conformance/sampler/sampler_adapter_level_zero.match deleted file mode 100644 index db656e2b95..0000000000 --- a/test/conformance/sampler/sampler_adapter_level_zero.match +++ /dev/null @@ -1,4 +0,0 @@ -{{OPT}}urSamplerGetInfoTestWithParam.Success/* -{{OPT}}urSamplerGetInfoTest.InvalidSizePropSizeSmall/* -{{OPT}}urSamplerReleaseTest.Success/* -{{OPT}}urSamplerRetainTest.Success/* diff --git a/test/conformance/sampler/sampler_adapter_level_zero_v2.match b/test/conformance/sampler/sampler_adapter_level_zero_v2.match deleted file mode 100644 index db656e2b95..0000000000 --- a/test/conformance/sampler/sampler_adapter_level_zero_v2.match +++ /dev/null @@ -1,4 +0,0 @@ -{{OPT}}urSamplerGetInfoTestWithParam.Success/* -{{OPT}}urSamplerGetInfoTest.InvalidSizePropSizeSmall/* -{{OPT}}urSamplerReleaseTest.Success/* -{{OPT}}urSamplerRetainTest.Success/* diff --git a/test/conformance/sampler/urSamplerCreate.cpp b/test/conformance/sampler/urSamplerCreate.cpp index ceb61247e1..8ce9f79a86 100644 --- a/test/conformance/sampler/urSamplerCreate.cpp +++ b/test/conformance/sampler/urSamplerCreate.cpp @@ -4,11 +4,14 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "uur/fixtures.h" +#include "uur/known_failure.h" #include "uur/raii.h" struct urSamplerCreateTestWithParam : public uur::urContextTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA Emulation Device"}); + UUR_RETURN_ON_FATAL_FAILURE( uur::urContextTestWithParam::SetUp()); @@ -34,7 +37,7 @@ struct urSamplerCreateTestWithParam } }; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urSamplerCreateTestWithParam, ::testing::Combine( ::testing::Values(true, false), diff --git a/test/conformance/sampler/urSamplerGetInfo.cpp b/test/conformance/sampler/urSamplerGetInfo.cpp index 9cf1a3f7ec..52ede42f6b 100644 --- a/test/conformance/sampler/urSamplerGetInfo.cpp +++ b/test/conformance/sampler/urSamplerGetInfo.cpp @@ -4,18 +4,22 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urSamplerGetInfoTestWithParam = uur::urSamplerTestWithParam; -UUR_TEST_SUITE_P(urSamplerGetInfoTestWithParam, - ::testing::Values(UR_SAMPLER_INFO_REFERENCE_COUNT, - UR_SAMPLER_INFO_CONTEXT, - UR_SAMPLER_INFO_NORMALIZED_COORDS, - UR_SAMPLER_INFO_ADDRESSING_MODE, - UR_SAMPLER_INFO_FILTER_MODE), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urSamplerGetInfoTestWithParam, + ::testing::Values(UR_SAMPLER_INFO_REFERENCE_COUNT, + UR_SAMPLER_INFO_CONTEXT, + UR_SAMPLER_INFO_NORMALIZED_COORDS, + UR_SAMPLER_INFO_ADDRESSING_MODE, + UR_SAMPLER_INFO_FILTER_MODE), + uur::deviceTestWithParamPrinter); TEST_P(urSamplerGetInfoTestWithParam, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + size_t size = 0; ur_sampler_info_t info = getParam(); ASSERT_SUCCESS_OR_OPTIONAL_QUERY( @@ -95,6 +99,9 @@ TEST_P(urSamplerGetInfoTest, InvalidSizePropSizeZero) { } TEST_P(urSamplerGetInfoTest, InvalidSizePropSizeSmall) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + ur_sampler_addressing_mode_t mode; ASSERT_EQ_RESULT(urSamplerGetInfo(sampler, UR_SAMPLER_INFO_ADDRESSING_MODE, sizeof(mode) - 1, &mode, nullptr), diff --git a/test/conformance/sampler/urSamplerRelease.cpp b/test/conformance/sampler/urSamplerRelease.cpp index 0cb69419d3..870b188b56 100644 --- a/test/conformance/sampler/urSamplerRelease.cpp +++ b/test/conformance/sampler/urSamplerRelease.cpp @@ -4,11 +4,15 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urSamplerReleaseTest = uur::urSamplerTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urSamplerReleaseTest); TEST_P(urSamplerReleaseTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + ASSERT_SUCCESS(urSamplerRetain(sampler)); uint32_t prevRefCount = 0; diff --git a/test/conformance/sampler/urSamplerRetain.cpp b/test/conformance/sampler/urSamplerRetain.cpp index da750800c8..82199c2129 100644 --- a/test/conformance/sampler/urSamplerRetain.cpp +++ b/test/conformance/sampler/urSamplerRetain.cpp @@ -4,11 +4,15 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urSamplerRetainTest = uur::urSamplerTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urSamplerRetainTest); TEST_P(urSamplerRetainTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + uint32_t prevRefCount = 0; ASSERT_SUCCESS(uur::GetObjectReferenceCount(sampler, prevRefCount)); diff --git a/test/conformance/source/environment.cpp b/test/conformance/source/environment.cpp index e1d1951616..d1ae15fa3d 100644 --- a/test/conformance/source/environment.cpp +++ b/test/conformance/source/environment.cpp @@ -80,6 +80,7 @@ constexpr std::pair backends[] = { }; namespace { +/* unused due to platform filtering being commented out constexpr const char *backend_to_str(ur_platform_backend_t backend) { for (auto b : backends) { if (b.second == backend) { @@ -87,7 +88,7 @@ constexpr const char *backend_to_str(ur_platform_backend_t backend) { } } return "INVALID"; -}; +};*/ ur_platform_backend_t str_to_backend(std::string str) { @@ -145,6 +146,7 @@ void uur::PlatformEnvironment::selectPlatformFromOptions() { urPlatformGet(&a, 1, count, platform_list.data(), nullptr)); for (auto p : platform_list) { + all_platforms.push_back(p); ur_platform_backend_t backend; ASSERT_SUCCESS(urPlatformGetInfo(p, UR_PLATFORM_INFO_BACKEND, sizeof(ur_platform_backend_t), @@ -196,7 +198,9 @@ void uur::PlatformEnvironment::selectPlatformFromOptions() { } return true; }); - + platform = platforms_filtered[0].platform; + adapter = platforms_filtered[0].adapter; + /* if (platforms_filtered.size() == 0) { std::stringstream errstr; errstr << "No platforms were found with the following filters:"; @@ -234,7 +238,7 @@ void uur::PlatformEnvironment::selectPlatformFromOptions() { << " --platform=\"" << p.name << "\"\n"; } FAIL() << errstr.str(); - } + }*/ } void uur::PlatformEnvironment::SetUp() { @@ -363,9 +367,26 @@ DevicesEnvironment::DevicesEnvironment(int argc, char **argv) return; } + for (auto &platform : all_platforms) { + uint32_t platform_device_count = 0; + urDeviceGet(platform, UR_DEVICE_TYPE_ALL, 0, nullptr, + &platform_device_count); + std::vector platform_devices(platform_device_count); + urDeviceGet(platform, UR_DEVICE_TYPE_ALL, platform_device_count, + platform_devices.data(), nullptr); + ur_adapter_handle_t adapter = nullptr; + urPlatformGetInfo(platform, UR_PLATFORM_INFO_ADAPTER, + sizeof(ur_adapter_handle_t), &adapter, nullptr); + // query out platform and adapter for each device, push back device tuple appropriately + for (auto device : platform_devices) { + devices.push_back(DeviceTuple({device, platform, adapter})); + } + } + // Get the argument (devices_count) to limit test devices count. // In case, the devices_count is "0", the variable count will not be changed. // The CTS will run on all devices. + /* filter devices with options after accumulating them all if (device_options.device_name.empty()) { if (device_options.devices_count > (std::numeric_limits::max)()) { @@ -420,7 +441,7 @@ DevicesEnvironment::DevicesEnvironment(int argc, char **argv) error = ss_error.str(); return; } - } + }*/ } void DevicesEnvironment::SetUp() { @@ -435,8 +456,8 @@ void DevicesEnvironment::SetUp() { void DevicesEnvironment::TearDown() { PlatformEnvironment::TearDown(); - for (auto device : devices) { - if (urDeviceRelease(device)) { + for (auto device_tuple : devices) { + if (urDeviceRelease(device_tuple.device)) { error = "urDeviceRelease() failed"; return; } diff --git a/test/conformance/testing/include/uur/checks.h b/test/conformance/testing/include/uur/checks.h index c0adb12453..d247c64b42 100644 --- a/test/conformance/testing/include/uur/checks.h +++ b/test/conformance/testing/include/uur/checks.h @@ -68,4 +68,22 @@ inline std::ostream &operator<<(std::ostream &out, return out; } +#define UUR_RETURN_ON_FATAL_FAILURE(...) \ + __VA_ARGS__; \ + if (this->HasFatalFailure() || this->IsSkipped()) { \ + return; \ + } \ + (void)0 + +#define UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(ret) \ + do { \ + auto status = ret; \ + if (status == UR_RESULT_ERROR_UNSUPPORTED_FEATURE || \ + status == UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION) { \ + GTEST_SKIP(); \ + } else { \ + ASSERT_EQ(status, UR_RESULT_SUCCESS); \ + } \ + } while (0) + #endif // UR_CONFORMANCE_INCLUDE_CHECKS_H_INCLUDED diff --git a/test/conformance/testing/include/uur/environment.h b/test/conformance/testing/include/uur/environment.h index 397858333f..54ca19685a 100644 --- a/test/conformance/testing/include/uur/environment.h +++ b/test/conformance/testing/include/uur/environment.h @@ -42,11 +42,20 @@ struct PlatformEnvironment : AdapterEnvironment { PlatformOptions parsePlatformOptions(int argc, char **argv); PlatformOptions platform_options; + // List of all discovered platforms + std::vector all_platforms; + // Adapter and platform selected for testing via platform_options ur_adapter_handle_t adapter = nullptr; ur_platform_handle_t platform = nullptr; static PlatformEnvironment *instance; }; +struct DeviceTuple { + ur_device_handle_t device; + ur_platform_handle_t platform; + ur_adapter_handle_t adapter; +}; + struct DevicesEnvironment : PlatformEnvironment { struct DeviceOptions { @@ -62,12 +71,12 @@ struct DevicesEnvironment : PlatformEnvironment { DeviceOptions parseDeviceOptions(int argc, char **argv); - inline const std::vector &GetDevices() const { + inline const std::vector &GetDevices() const { return devices; } DeviceOptions device_options; - std::vector devices; + std::vector devices; ur_device_handle_t device = nullptr; static DevicesEnvironment *instance; }; diff --git a/test/conformance/testing/include/uur/fixtures.h b/test/conformance/testing/include/uur/fixtures.h index 5a409e465c..04c3b1fa7f 100644 --- a/test/conformance/testing/include/uur/fixtures.h +++ b/test/conformance/testing/include/uur/fixtures.h @@ -7,32 +7,14 @@ #define UR_CONFORMANCE_INCLUDE_FIXTURES_H_INCLUDED #include "ur_api.h" -#include "ur_ddi.h" #include #include +#include #include #include -#define UUR_RETURN_ON_FATAL_FAILURE(...) \ - __VA_ARGS__; \ - if (this->HasFatalFailure() || this->IsSkipped()) { \ - return; \ - } \ - (void)0 - -#define UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(ret) \ - do { \ - auto status = ret; \ - if (status == UR_RESULT_ERROR_UNSUPPORTED_FEATURE || \ - status == UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION) { \ - GTEST_SKIP(); \ - } else { \ - ASSERT_EQ(status, UR_RESULT_SUCCESS); \ - } \ - } while (0) - namespace uur { struct urAdapterTest : ::testing::Test, @@ -42,14 +24,15 @@ struct urAdapterTest : ::testing::Test, ur_adapter_handle_t adapter; }; -struct urPlatformTest : ::testing::Test { - void SetUp() override { - platform = uur::PlatformEnvironment::instance->platform; - adapter = uur::PlatformEnvironment::instance->adapter; - } +// In the vein of urAdapterTest and urDeviceTest this is a parameterized +// platform fixture which can be instantiated via +// UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P to run tests on each discovered +// platform. +struct urPlatformTest : ::testing::Test, + ::testing::WithParamInterface { + void SetUp() override { platform = GetParam(); } ur_platform_handle_t platform = nullptr; - ur_adapter_handle_t adapter = nullptr; }; inline std::pair> @@ -97,20 +80,22 @@ struct urAllDevicesTest : urPlatformTest { std::vector devices; }; -struct urDeviceTest : urPlatformTest, - ::testing::WithParamInterface { +struct urDeviceTest : ::testing::Test, + ::testing::WithParamInterface { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urPlatformTest::SetUp()); - device = GetParam(); - EXPECT_SUCCESS(urDeviceRetain(device)); + // TODO: change these to accessors like getDevice, getPlatform etc? + // downside: touch a lot of tests (many many tests just use `device` in + // place) + // upside: using the accessors means SetUp doesn't need to run before + // you can access device etc. to check for test compatibility + device = GetParam().device; + platform = GetParam().platform; + adapter = GetParam().adapter; } - void TearDown() override { - EXPECT_SUCCESS(urDeviceRelease(device)); - UUR_RETURN_ON_FATAL_FAILURE(urPlatformTest::TearDown()); - } - - ur_device_handle_t device; + ur_device_handle_t device = nullptr; + ur_platform_handle_t platform = nullptr; + ur_adapter_handle_t adapter = nullptr; }; } // namespace uur @@ -122,35 +107,78 @@ struct urDeviceTest : urPlatformTest, return uur::GetAdapterBackendName(info.param); \ }) +#define UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(FIXTURE) \ + INSTANTIATE_TEST_SUITE_P( \ + , FIXTURE, \ + ::testing::ValuesIn( \ + uur::PlatformEnvironment::instance->all_platforms), \ + [](const ::testing::TestParamInfo &info) { \ + return uur::GetPlatformNameWithID(info.param); \ + }) + #define UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(FIXTURE) \ INSTANTIATE_TEST_SUITE_P( \ , FIXTURE, \ ::testing::ValuesIn(uur::DevicesEnvironment::instance->devices), \ - [](const ::testing::TestParamInfo &info) { \ - return uur::GetPlatformAndDeviceName(info.param); \ + [](const ::testing::TestParamInfo &info) { \ + return uur::GetPlatformAndDeviceName(info.param.device); \ }) #define UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(FIXTURE) \ INSTANTIATE_TEST_SUITE_P( \ , FIXTURE, \ ::testing::ValuesIn(uur::KernelsEnvironment::instance->devices), \ - [](const ::testing::TestParamInfo &info) { \ - return uur::GetPlatformAndDeviceName(info.param); \ + [](const ::testing::TestParamInfo &info) { \ + return uur::GetPlatformAndDeviceName(info.param.device); \ }) namespace uur { +template +struct urPlatformTestWithParam + : ::testing::Test, + ::testing::WithParamInterface> { + void SetUp() override { platform = std::get<0>(this->GetParam()); } + const T &getParam() const { return std::get<1>(this->GetParam()); } + ur_platform_handle_t platform; +}; + +template +struct urAllDevicesTestWithParam : urPlatformTestWithParam { + void SetUp() override { + UUR_RETURN_ON_FATAL_FAILURE(urPlatformTestWithParam::SetUp()); + auto devicesPair = GetDevices(this->platform); + if (!devicesPair.first) { + FAIL() << "Failed to get devices"; + } + devices = std::move(devicesPair.second); + } + + void TearDown() override { + for (auto &device : devices) { + EXPECT_SUCCESS(urDeviceRelease(device)); + } + UUR_RETURN_ON_FATAL_FAILURE(urPlatformTestWithParam::TearDown()); + } + + std::vector devices; +}; + template struct urDeviceTestWithParam - : urPlatformTest, - ::testing::WithParamInterface> { + : ::testing::Test, + ::testing::WithParamInterface> { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urPlatformTest::SetUp()); - device = std::get<0>(this->GetParam()); + auto &device_tuple = std::get<0>(this->GetParam()); + device = device_tuple.device; + platform = device_tuple.platform; + adapter = device_tuple.adapter; } // TODO - I don't like the confusion with GetParam(); const T &getParam() const { return std::get<1>(this->GetParam()); } ur_device_handle_t device; + ur_platform_handle_t platform; + ur_adapter_handle_t adapter; }; struct urContextTest : urDeviceTest { @@ -161,7 +189,9 @@ struct urContextTest : urDeviceTest { } void TearDown() override { - EXPECT_SUCCESS(urContextRelease(context)); + if (context) { + EXPECT_SUCCESS(urContextRelease(context)); + } UUR_RETURN_ON_FATAL_FAILURE(urDeviceTest::TearDown()); } @@ -170,6 +200,7 @@ struct urContextTest : urDeviceTest { struct urSamplerTest : urContextTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA Emulation Device"}); UUR_RETURN_ON_FATAL_FAILURE(urContextTest::SetUp()); sampler_desc = { UR_STRUCTURE_TYPE_SAMPLER_DESC, /* stype */ @@ -219,7 +250,7 @@ struct urMemImageTest : urContextTest { UUR_RETURN_ON_FATAL_FAILURE(urContextTest::SetUp()); ur_bool_t imageSupported = false; ASSERT_SUCCESS( - urDeviceGetInfo(this->device, UR_DEVICE_INFO_IMAGE_SUPPORTED, + urDeviceGetInfo(this->device, UR_DEVICE_INFO_IMAGE_SUPPORT, sizeof(ur_bool_t), &imageSupported, nullptr)); if (!imageSupported) { GTEST_SKIP(); @@ -258,7 +289,16 @@ struct urMemImageTest : urContextTest { } // namespace uur -#define UUR_TEST_SUITE_P(FIXTURE, VALUES, PRINTER) \ +#define UUR_PLATFORM_TEST_SUITE_P(FIXTURE, VALUES, PRINTER) \ + INSTANTIATE_TEST_SUITE_P( \ + , FIXTURE, \ + testing::Combine( \ + ::testing::ValuesIn( \ + uur::PlatformEnvironment::instance->all_platforms), \ + VALUES), \ + PRINTER) + +#define UUR_DEVICE_TEST_SUITE_P(FIXTURE, VALUES, PRINTER) \ INSTANTIATE_TEST_SUITE_P( \ , FIXTURE, \ testing::Combine( \ @@ -275,14 +315,17 @@ template struct urContextTestWithParam : urDeviceTestWithParam { } void TearDown() override { - EXPECT_SUCCESS(urContextRelease(context)); + if (context) { + EXPECT_SUCCESS(urContextRelease(context)); + } UUR_RETURN_ON_FATAL_FAILURE(urDeviceTestWithParam::TearDown()); } - ur_context_handle_t context; + ur_context_handle_t context = nullptr; }; template struct urSamplerTestWithParam : urContextTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA Emulation Device"}); UUR_RETURN_ON_FATAL_FAILURE(urContextTestWithParam::SetUp()); sampler_desc = { UR_STRUCTURE_TYPE_SAMPLER_DESC, /* stype */ @@ -333,7 +376,7 @@ template struct urMemImageTestWithParam : urContextTestWithParam { UUR_RETURN_ON_FATAL_FAILURE(urContextTestWithParam::SetUp()); ur_bool_t imageSupported = false; ASSERT_SUCCESS( - urDeviceGetInfo(this->device, UR_DEVICE_INFO_IMAGE_SUPPORTED, + urDeviceGetInfo(this->device, UR_DEVICE_INFO_IMAGE_SUPPORT, sizeof(ur_bool_t), &imageSupported, nullptr)); if (!imageSupported) { GTEST_SKIP(); @@ -388,19 +431,26 @@ struct urQueueTest : urContextTest { struct urHostPipeTest : urQueueTest { void SetUp() override { + // We haven't got device code tests working on native cpu yet. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + // The host pipe support query isn't implement on l0 + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); size_t size = 0; - ASSERT_SUCCESS(urDeviceGetInfo( - device, UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED, 0, nullptr, - &size)); + ASSERT_SUCCESS( + urDeviceGetInfo(device, UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORT, + 0, nullptr, &size)); ASSERT_NE(size, 0); ASSERT_EQ(sizeof(ur_bool_t), size); void *info_data = alloca(size); - ASSERT_SUCCESS(urDeviceGetInfo( - device, UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED, size, - info_data, nullptr)); + ASSERT_SUCCESS( + urDeviceGetInfo(device, UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORT, + size, info_data, nullptr)); ASSERT_NE(info_data, nullptr); bool supported; @@ -561,10 +611,9 @@ struct urMultiQueueTestWithParam : urContextTestWithParam { }; template -struct urMultiDeviceContextTestTemplate : urPlatformTest { +struct urMultiDeviceContextTestTemplate : urAllDevicesTest { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urPlatformTest::SetUp()); - auto &devices = DevicesEnvironment::instance->devices; + UUR_RETURN_ON_FATAL_FAILURE(urAllDevicesTest::SetUp()); if (devices.size() < MinDevices) { GTEST_SKIP(); } @@ -576,7 +625,7 @@ struct urMultiDeviceContextTestTemplate : urPlatformTest { if (context) { ASSERT_SUCCESS(urContextRelease(context)); } - UUR_RETURN_ON_FATAL_FAILURE(urPlatformTest::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urAllDevicesTest::TearDown()); } ur_context_handle_t context = nullptr; @@ -609,8 +658,8 @@ struct urMultiDeviceMemBufferTest : urMultiDeviceContextTest { struct urMultiDeviceMemBufferQueueTest : urMultiDeviceMemBufferTest { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urMultiDeviceMemBufferTest::SetUp()); - queues.reserve(DevicesEnvironment::instance->devices.size()); - for (const auto &device : DevicesEnvironment::instance->devices) { + queues.reserve(devices.size()); + for (const auto &device : devices) { ur_queue_handle_t queue = nullptr; ASSERT_SUCCESS(urQueueCreate(context, device, 0, &queue)); queues.push_back(queue); @@ -651,7 +700,7 @@ struct urMemImageQueueTest : urQueueTest { UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); ur_bool_t imageSupported = false; ASSERT_SUCCESS( - urDeviceGetInfo(this->device, UR_DEVICE_INFO_IMAGE_SUPPORTED, + urDeviceGetInfo(this->device, UR_DEVICE_INFO_IMAGE_SUPPORT, sizeof(ur_bool_t), &imageSupported, nullptr)); if (!imageSupported) { GTEST_SKIP(); @@ -731,11 +780,11 @@ struct urMemImageQueueTest : urQueueTest { struct urMultiDeviceMemImageTest : urMultiDeviceContextTest { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urMultiDeviceContextTest::SetUp()); - for (auto device : DevicesEnvironment::instance->devices) { + for (auto device : devices) { ur_bool_t imageSupported = false; - ASSERT_SUCCESS( - urDeviceGetInfo(device, UR_DEVICE_INFO_IMAGE_SUPPORTED, - sizeof(ur_bool_t), &imageSupported, nullptr)); + ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_IMAGE_SUPPORT, + sizeof(ur_bool_t), &imageSupported, + nullptr)); if (!imageSupported) { GTEST_SKIP(); } @@ -815,8 +864,8 @@ struct urMultiDeviceMemImageTest : urMultiDeviceContextTest { struct urMultiDeviceMemImageQueueTest : urMultiDeviceMemImageTest { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urMultiDeviceMemImageTest::SetUp()); - queues.reserve(DevicesEnvironment::instance->devices.size()); - for (const auto &device : DevicesEnvironment::instance->devices) { + queues.reserve(devices.size()); + for (const auto &device : devices) { ur_queue_handle_t queue = nullptr; ASSERT_SUCCESS(urQueueCreate(context, device, 0, &queue)); queues.push_back(queue); @@ -882,7 +931,9 @@ struct urUSMDeviceAllocTest : urQueueTest { } void TearDown() override { - ASSERT_SUCCESS(urUSMFree(context, ptr)); + if (ptr) { + ASSERT_SUCCESS(urUSMFree(context, ptr)); + } uur::urQueueTest::TearDown(); } @@ -938,6 +989,8 @@ template struct urUSMPoolTestWithParam : urContextTestWithParam { struct urVirtualMemGranularityTest : urContextTest { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(urContextTest::SetUp()); ur_bool_t virtual_memory_support = false; @@ -958,6 +1011,8 @@ struct urVirtualMemGranularityTest : urContextTest { template struct urVirtualMemGranularityTestWithParam : urContextTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE(urContextTestWithParam::SetUp()); ur_bool_t virtual_memory_support = false; @@ -1169,14 +1224,26 @@ inline void generateMemFillPattern(std::vector &pattern) { std::generate(begin(pattern), end(pattern), gen); } +template +std::string platformTestWithParamPrinter( + const ::testing::TestParamInfo> &info) { + auto platform = std::get<0>(info.param); + auto param = std::get<1>(info.param); + + std::stringstream ss; + ss << param; + return uur::GetPlatformNameWithID(platform) + "__" + + GTestSanitizeString(ss.str()); +} + /// @brief /// @tparam T /// @param info /// @return template std::string deviceTestWithParamPrinter( - const ::testing::TestParamInfo> &info) { - auto device = std::get<0>(info.param); + const ::testing::TestParamInfo> &info) { + auto device = std::get<0>(info.param).device; auto param = std::get<1>(info.param); std::stringstream ss; @@ -1186,8 +1253,8 @@ std::string deviceTestWithParamPrinter( template <> std::string deviceTestWithParamPrinter( - const ::testing::TestParamInfo< - std::tuple> &info); + const ::testing::TestParamInfo> + &info); // Helper struct to allow bool param tests with meaningful names. struct BoolTestParam { @@ -1202,19 +1269,27 @@ struct BoolTestParam { template <> std::string deviceTestWithParamPrinter( + const ::testing::TestParamInfo> + &info); + +template <> +std::string platformTestWithParamPrinter( const ::testing::TestParamInfo< - std::tuple> &info); + std::tuple> &info); using SamplerCreateParamT = std::tuple; template <> std::string deviceTestWithParamPrinter( - const ::testing::TestParamInfo< - std::tuple> &info); + const ::testing::TestParamInfo> + &info); struct urProgramTest : urQueueTest { void SetUp() override { + // We haven't got device code tests working on native cpu yet. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); ur_platform_backend_t backend; @@ -1252,6 +1327,9 @@ struct urProgramTest : urQueueTest { template struct urProgramTestWithParam : urQueueTestWithParam { void SetUp() override { + // We haven't got device code tests working on native cpu yet. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam::SetUp()); ur_platform_backend_t backend; @@ -1293,6 +1371,9 @@ template struct urProgramTestWithParam : urQueueTestWithParam { // instead. struct urBaseKernelTest : urProgramTest { void SetUp() override { + // We haven't got device code tests working on native cpu yet. + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + UUR_RETURN_ON_FATAL_FAILURE(urProgramTest::SetUp()); auto kernel_names = uur::KernelsEnvironment::instance->GetEntryPointNames(program_name); @@ -1318,7 +1399,7 @@ struct urBaseKernelTest : urProgramTest { struct urKernelTest : urBaseKernelTest { void SetUp() override { - urBaseKernelTest::SetUp(); + UUR_RETURN_ON_FATAL_FAILURE(urBaseKernelTest::SetUp()); Build(); } }; @@ -1606,8 +1687,8 @@ struct urGlobalVariableTest : uur::urKernelExecutionTest { struct urMultiDeviceQueueTest : urMultiDeviceContextTest { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urMultiDeviceContextTest::SetUp()); - queues.reserve(DevicesEnvironment::instance->devices.size()); - for (const auto &device : DevicesEnvironment::instance->devices) { + queues.reserve(devices.size()); + for (const auto &device : devices) { ur_queue_handle_t queue = nullptr; ASSERT_SUCCESS(urQueueCreate(context, device, 0, &queue)); queues.push_back(queue); @@ -1636,7 +1717,6 @@ struct urMultiDeviceProgramTest : urMultiDeviceQueueTest { backend == UR_PLATFORM_BACKEND_CUDA) { GTEST_SKIP(); } - devices = uur::DevicesEnvironment::instance->devices; if (devices.size() < 2) { GTEST_SKIP(); } @@ -1665,7 +1745,6 @@ struct urMultiDeviceProgramTest : urMultiDeviceQueueTest { std::string program_name = "foo"; ur_program_handle_t program = nullptr; std::vector metadatas{}; - std::vector devices; }; } // namespace uur diff --git a/test/conformance/testing/include/uur/known_failure.h b/test/conformance/testing/include/uur/known_failure.h new file mode 100644 index 0000000000..56a0f13cb0 --- /dev/null +++ b/test/conformance/testing/include/uur/known_failure.h @@ -0,0 +1,214 @@ +// Copyright (C) 2024 Intel Corporation +// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef UR_CONFORMANCE_INCLUDE_KNOWN_FAILURE_H_INCLUDED +#define UR_CONFORMANCE_INCLUDE_KNOWN_FAILURE_H_INCLUDED + +#include "uur/environment.h" +#include "uur/utils.h" +#include +#include +#include +#include + +namespace uur { +struct Matcher { + Matcher(uint32_t adapterVersion, ur_adapter_backend_t backend, + std::vector deviceNames) + : adapterVersion(adapterVersion), backend(backend), names(deviceNames) { + } + + uint32_t adapterVersion; + ur_adapter_backend_t backend; + std::vector names; +}; + +struct OpenCL : Matcher { + OpenCL(std::initializer_list il) + : Matcher(1, UR_ADAPTER_BACKEND_OPENCL, {il.begin(), il.end()}) {} +}; + +struct LevelZero : Matcher { + LevelZero(std::initializer_list il) + : Matcher(1, UR_ADAPTER_BACKEND_LEVEL_ZERO, {il.begin(), il.end()}) {} +}; + +struct LevelZeroV2 : Matcher { + LevelZeroV2(std::initializer_list il) + : Matcher(2, UR_ADAPTER_BACKEND_LEVEL_ZERO, {il.begin(), il.end()}) {} +}; + +struct CUDA : Matcher { + CUDA(std::initializer_list il) + : Matcher(1, UR_ADAPTER_BACKEND_CUDA, {il.begin(), il.end()}) {} +}; + +struct HIP : Matcher { + HIP(std::initializer_list il) + : Matcher(1, UR_ADAPTER_BACKEND_HIP, {il.begin(), il.end()}) {} +}; + +struct NativeCPU : Matcher { + NativeCPU(std::initializer_list il) + : Matcher(1, UR_ADAPTER_BACKEND_NATIVE_CPU, {il.begin(), il.end()}) {} +}; + +namespace detail { +struct AdapterInfo { + uint32_t version; + ur_adapter_backend_t backend; +}; + +inline AdapterInfo getAdapterInfo(ur_adapter_handle_t adapter) { + AdapterInfo info; + urAdapterGetInfo(adapter, UR_ADAPTER_INFO_VERSION, sizeof(info.version), + &info.version, nullptr); + urAdapterGetInfo(adapter, UR_ADAPTER_INFO_BACKEND, sizeof(info.backend), + &info.backend, nullptr); + return info; +} +} // namespace detail + +inline bool isKnownFailureOn(ur_adapter_handle_t adapter, + const std::vector &matchers) { + for (const auto &matcher : matchers) { + auto adapterInfo = detail::getAdapterInfo(adapter); + if (matcher.adapterVersion == adapterInfo.version && + matcher.backend == adapterInfo.backend) { + return true; + } + } + return false; +} + +inline bool isKnownFailureOn(ur_platform_handle_t platform, + const std::vector &matchers) { + ur_adapter_handle_t adapter; + urPlatformGetInfo(platform, UR_PLATFORM_INFO_ADAPTER, + sizeof(ur_adapter_handle_t), &adapter, nullptr); + for (const auto &matcher : matchers) { + auto adapterInfo = detail::getAdapterInfo(adapter); + if (matcher.adapterVersion != adapterInfo.version && + matcher.backend != adapterInfo.backend) { + continue; + } + if (matcher.names.empty()) { + return true; + } + std::string name; + uur::GetPlatformInfo(platform, UR_PLATFORM_INFO_NAME, + name); + for (const auto &matcherName : matcher.names) { + if (name.find(matcherName) != std::string::npos) { + return true; + } + } + } + return false; +} + +template +inline bool +isKnownFailureOn(const std::tuple ¶m, + const std::vector &matchers) { + ur_platform_handle_t platform = std::get<0>(param); + return isKnownFailureOn(platform, matchers); +} + +inline bool isKnownFailureOn(const DeviceTuple ¶m, + const std::vector &matchers) { + for (const auto &matcher : matchers) { + auto adapterInfo = detail::getAdapterInfo(param.adapter); + if (matcher.backend != adapterInfo.backend) { + continue; + } + if (matcher.adapterVersion != adapterInfo.version) { + continue; + } + if (matcher.names.empty()) { + return true; + } + std::string name; + uur::GetDeviceInfo(param.device, UR_DEVICE_INFO_NAME, + name); + for (const auto &matcherName : matcher.names) { + if (name.find(matcherName) != std::string::npos) { + return true; + } + } + } + return false; +} + +template +inline bool isKnownFailureOn(const std::tuple ¶m, + const std::vector &matchers) { + return isKnownFailureOn(std::get<0>(param), matchers); +} + +inline std::string knownFailureMessage(ur_adapter_handle_t adapter) { + std::string backend = uur::GetAdapterBackendName(adapter); + return "Known failure on: " + backend; +} + +inline std::string knownFailureMessage(ur_platform_handle_t platform) { + ur_adapter_handle_t adapter; + urPlatformGetInfo(platform, UR_PLATFORM_INFO_ADAPTER, + sizeof(ur_adapter_handle_t), &adapter, nullptr); + std::string backend = uur::GetAdapterBackendName(adapter); + std::string platformName; + uur::GetPlatformInfo(platform, UR_PLATFORM_INFO_NAME, + platformName); + return "Known failure on: " + backend + ", " + platformName; +} + +template +inline std::string +knownFailureMessage(const std::tuple ¶m) { + ur_platform_handle_t platform = std::get<0>(param); + return knownFailureMessage(platform); +} + +inline std::string knownFailureMessage(const DeviceTuple ¶m) { + std::string backend = uur::GetAdapterBackendName(param.adapter); + std::string platformName; + uur::GetPlatformInfo(param.platform, UR_PLATFORM_INFO_NAME, + platformName); + std::string deviceName; + uur::GetDeviceInfo(param.device, UR_DEVICE_INFO_NAME, + deviceName); + return "Known failure on: " + backend + ", " + platformName + ", " + + deviceName; +} + +template +inline std::string +knownFailureMessage(const std::tuple ¶m) { + return knownFailureMessage(std::get<0>(param)); +} + +inline bool alsoRunKnownFailures() { + if (const char *envvar = std::getenv("UR_CTS_ALSO_RUN_KNOWN_FAILURES")) { + std::string_view value(envvar); + return value == "1" || value == "ON" || value == "on" || + value == "YES" || value == "yes" || value == "true" || + value == "TRUE"; + } + return false; +} +} // namespace uur + +#define UUR_KNOWN_FAILURE_ON(...) \ + if (uur::isKnownFailureOn(this->GetParam(), {__VA_ARGS__})) { \ + auto message = uur::knownFailureMessage(this->GetParam()); \ + if (uur::alsoRunKnownFailures()) { \ + std::cerr << message << "\n"; \ + } else { \ + GTEST_SKIP() << message; \ + } \ + } \ + (void)0 + +#endif // UR_CONFORMANCE_INCLUDE_KNOWN_FAILURE_H_INCLUDED diff --git a/test/conformance/testing/include/uur/utils.h b/test/conformance/testing/include/uur/utils.h index 2415e580c5..ea5a522244 100644 --- a/test/conformance/testing/include/uur/utils.h +++ b/test/conformance/testing/include/uur/utils.h @@ -43,12 +43,13 @@ ur_result_t GetInfo(ObjectTy object, InfoTy info, Callable cb, T &out_value) { // special case for strings if constexpr (std::is_same_v) { - std::vector data(size); - result = cb(object, info, size, data.data(), nullptr); + std::string value(size, '\0'); + result = cb(object, info, size, value.data(), nullptr); if (result != UR_RESULT_SUCCESS) { return result; } - out_value = std::string(data.data(), data.size()); + out_value = + value.substr(0, std::min(value.find_last_of('\0'), value.size())); return UR_RESULT_SUCCESS; } else { if (size != sizeof(T)) { @@ -190,6 +191,15 @@ inline std::string GetPlatformName(ur_platform_handle_t hPlatform) { std::string(platform_name.data(), platform_name.size())); } +inline std::string GetPlatformNameWithID(ur_platform_handle_t hPlatform) { + auto platform_name = GetPlatformName(hPlatform); + auto &platforms = uur::PlatformEnvironment::instance->all_platforms; + size_t platform_id = + std::find(platforms.begin(), platforms.end(), hPlatform) - + platforms.begin(); + return platform_name + "_ID" + std::to_string(platform_id); +} + inline std::string GetDeviceName(ur_device_handle_t device) { std::string device_name, device_uuid; GetDeviceInfo(device, UR_DEVICE_INFO_NAME, device_name); @@ -201,15 +211,22 @@ inline std::string GetDeviceName(ur_device_handle_t device) { size_t device_id = 0; if (uur::DevicesEnvironment::instance) { auto &devices = uur::DevicesEnvironment::instance->devices; + auto TupleContainsDevice = [device](DeviceTuple &tuple) -> bool { + return device == tuple.device; + }; device_id = - std::find(devices.begin(), devices.end(), device) - devices.begin(); + std::find_if(devices.begin(), devices.end(), TupleContainsDevice) - + devices.begin(); } return GTestSanitizeString(device_name + "_ID" + std::to_string(device_id) + "ID_" + device_uuid); } inline std::string GetPlatformAndDeviceName(ur_device_handle_t device) { - return GetPlatformName(GetPlatform()) + "__" + GetDeviceName(device); + ur_platform_handle_t platform = nullptr; + urDeviceGetInfo(device, UR_DEVICE_INFO_PLATFORM, + sizeof(ur_platform_handle_t), &platform, nullptr); + return GetPlatformName(platform) + "__" + GetDeviceName(device); } ur_result_t GetDeviceType(ur_device_handle_t device, diff --git a/test/conformance/testing/source/fixtures.cpp b/test/conformance/testing/source/fixtures.cpp index bdb80c60be..ff29e1a2d9 100644 --- a/test/conformance/testing/source/fixtures.cpp +++ b/test/conformance/testing/source/fixtures.cpp @@ -8,9 +8,9 @@ namespace uur { template <> std::string deviceTestWithParamPrinter( - const ::testing::TestParamInfo< - std::tuple> &info) { - auto device = std::get<0>(info.param); + const ::testing::TestParamInfo> + &info) { + auto device = std::get<0>(info.param).device; auto param = std::get<1>(info.param); std::stringstream ss; @@ -18,11 +18,23 @@ std::string deviceTestWithParamPrinter( return uur::GetPlatformAndDeviceName(device) + "__" + ss.str(); } +template <> +std::string platformTestWithParamPrinter( + const ::testing::TestParamInfo< + std::tuple> &info) { + auto platform = std::get<0>(info.param); + auto param = std::get<1>(info.param); + + std::stringstream ss; + ss << param.name << (param.value ? "Enabled" : "Disabled"); + return uur::GetPlatformNameWithID(platform) + "__" + ss.str(); +} + template <> std::string deviceTestWithParamPrinter( const ::testing::TestParamInfo< - std::tuple> &info) { - auto device = std::get<0>(info.param); + std::tuple> &info) { + auto device = std::get<0>(info.param).device; auto param = std::get<1>(info.param); const auto normalized = std::get<0>(param); @@ -42,9 +54,9 @@ std::string deviceTestWithParamPrinter( template <> std::string deviceTestWithParamPrinter( - const ::testing::TestParamInfo< - std::tuple> &info) { - auto device = std::get<0>(info.param); + const ::testing::TestParamInfo> + &info) { + auto device = std::get<0>(info.param).device; auto param = std::get<1>(info.param); auto ChannelOrder = param.channelOrder; auto ChannelType = param.channelType; diff --git a/test/conformance/testing/source/utils.cpp b/test/conformance/testing/source/utils.cpp index 6931d3c761..c611b4c00f 100644 --- a/test/conformance/testing/source/utils.cpp +++ b/test/conformance/testing/source/utils.cpp @@ -213,7 +213,7 @@ ur_result_t GetDeviceMaxMemAllocSize(ur_device_handle_t device, ur_result_t GetDeviceImageSupport(ur_device_handle_t device, bool &image_support) { - return GetDeviceInfo(device, UR_DEVICE_INFO_IMAGE_SUPPORTED, + return GetDeviceInfo(device, UR_DEVICE_INFO_IMAGE_SUPPORT, image_support); } @@ -640,7 +640,7 @@ ur_result_t GetDeviceMaxComputeQueueIndices(ur_device_handle_t device, ur_result_t GetDeviceHostPipeRWSupported(ur_device_handle_t device, bool &support) { return GetDeviceInfo( - device, UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED, support); + device, UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORT, support); } ur_result_t GetTimestampRecordingSupport(ur_device_handle_t device, diff --git a/test/conformance/usm/helpers.h b/test/conformance/usm/helpers.h index 26958208e3..ba9a37ac76 100644 --- a/test/conformance/usm/helpers.h +++ b/test/conformance/usm/helpers.h @@ -16,7 +16,7 @@ template inline std::string printUSMAllocTestString( const testing::TestParamInfo &info) { // ParamType will be std::tuple - const auto device_handle = std::get<0>(info.param); + const auto device_handle = std::get<0>(info.param).device; const auto platform_device_name = uur::GetPlatformAndDeviceName(device_handle); const auto &usmDeviceAllocParams = std::get<1>(info.param); diff --git a/test/conformance/usm/urUSMDeviceAlloc.cpp b/test/conformance/usm/urUSMDeviceAlloc.cpp index bfc48c2aa6..acefff3bfe 100644 --- a/test/conformance/usm/urUSMDeviceAlloc.cpp +++ b/test/conformance/usm/urUSMDeviceAlloc.cpp @@ -5,6 +5,7 @@ #include "helpers.h" #include "uur/utils.h" #include +#include struct urUSMDeviceAllocTest : uur::urQueueTestWithParam { @@ -44,7 +45,7 @@ struct urUSMDeviceAllocTest // The 0 value parameters are not relevant for urUSMDeviceAllocTest tests, they // are used below in urUSMDeviceAllocAlignmentTest for allocation size and // alignment values -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urUSMDeviceAllocTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), @@ -52,6 +53,8 @@ UUR_TEST_SUITE_P( uur::printUSMAllocTestString); TEST_P(urUSMDeviceAllocTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + void *ptr = nullptr; size_t allocation_size = sizeof(int); ASSERT_SUCCESS(urUSMDeviceAlloc(context, device, nullptr, pool, @@ -115,6 +118,11 @@ TEST_P(urUSMDeviceAllocTest, InvalidNullPtrResult) { } TEST_P(urUSMDeviceAllocTest, InvalidUSMSize) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + void *ptr = nullptr; ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_USM_SIZE, @@ -133,7 +141,7 @@ TEST_P(urUSMDeviceAllocTest, InvalidValueAlignPowerOfTwo) { using urUSMDeviceAllocAlignmentTest = urUSMDeviceAllocTest; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urUSMDeviceAllocAlignmentTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), diff --git a/test/conformance/usm/urUSMFree.cpp b/test/conformance/usm/urUSMFree.cpp index 5ca4df3c9d..fc75e225fa 100644 --- a/test/conformance/usm/urUSMFree.cpp +++ b/test/conformance/usm/urUSMFree.cpp @@ -4,11 +4,14 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urUSMFreeTest = uur::urQueueTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urUSMFreeTest); TEST_P(urUSMFreeTest, SuccessDeviceAlloc) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_device_usm_access_capability_flags_t deviceUSMSupport = 0; ASSERT_SUCCESS(uur::GetDeviceUSMDeviceSupport(device, deviceUSMSupport)); if (!deviceUSMSupport) { @@ -33,6 +36,8 @@ TEST_P(urUSMFreeTest, SuccessDeviceAlloc) { ASSERT_SUCCESS(urEventRelease(event)); } TEST_P(urUSMFreeTest, SuccessHostAlloc) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_device_usm_access_capability_flags_t hostUSMSupport = 0; ASSERT_SUCCESS(uur::GetDeviceUSMDeviceSupport(device, hostUSMSupport)); if (!hostUSMSupport) { @@ -57,6 +62,8 @@ TEST_P(urUSMFreeTest, SuccessHostAlloc) { } TEST_P(urUSMFreeTest, SuccessSharedAlloc) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_device_usm_access_capability_flags_t shared_usm_cross = 0; ur_device_usm_access_capability_flags_t shared_usm_single = 0; diff --git a/test/conformance/usm/urUSMGetMemAllocInfo.cpp b/test/conformance/usm/urUSMGetMemAllocInfo.cpp index 38719379a9..88eef3526d 100644 --- a/test/conformance/usm/urUSMGetMemAllocInfo.cpp +++ b/test/conformance/usm/urUSMGetMemAllocInfo.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include struct urUSMGetMemAllocInfoTest : uur::urUSMDeviceAllocTestWithParam { @@ -14,13 +15,13 @@ struct urUSMGetMemAllocInfoTest } }; -UUR_TEST_SUITE_P(urUSMGetMemAllocInfoTest, - ::testing::Values(UR_USM_ALLOC_INFO_TYPE, - UR_USM_ALLOC_INFO_BASE_PTR, - UR_USM_ALLOC_INFO_SIZE, - UR_USM_ALLOC_INFO_DEVICE, - UR_USM_ALLOC_INFO_POOL), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urUSMGetMemAllocInfoTest, + ::testing::Values(UR_USM_ALLOC_INFO_TYPE, + UR_USM_ALLOC_INFO_BASE_PTR, + UR_USM_ALLOC_INFO_SIZE, + UR_USM_ALLOC_INFO_DEVICE, + UR_USM_ALLOC_INFO_POOL), + uur::deviceTestWithParamPrinter); static std::unordered_map usm_info_size_map = { {UR_USM_ALLOC_INFO_TYPE, sizeof(ur_usm_type_t)}, @@ -31,8 +32,19 @@ static std::unordered_map usm_info_size_map = { }; TEST_P(urUSMGetMemAllocInfoTest, Success) { + // These fail on native cpu because the fixture ends up doing a + // urQueueFlush() during TearDown and native cpu returns UNSUPPORTED_FEATURE + // this could potentially be resolved by making it a no-op instead + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + size_t size = 0; auto alloc_info = getParam(); + + if (alloc_info == UR_USM_ALLOC_INFO_POOL) { + UUR_KNOWN_FAILURE_ON(uur::OpenCL{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + } + ASSERT_SUCCESS_OR_OPTIONAL_QUERY( urUSMGetMemAllocInfo(context, ptr, alloc_info, 0, nullptr, &size), alloc_info); @@ -84,6 +96,8 @@ using urUSMGetMemAllocInfoNegativeTest = uur::urUSMDeviceAllocTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urUSMGetMemAllocInfoNegativeTest); TEST_P(urUSMGetMemAllocInfoNegativeTest, InvalidNullHandleContext) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_usm_type_t USMType; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, urUSMGetMemAllocInfo(nullptr, ptr, UR_USM_ALLOC_INFO_TYPE, @@ -92,6 +106,8 @@ TEST_P(urUSMGetMemAllocInfoNegativeTest, InvalidNullHandleContext) { } TEST_P(urUSMGetMemAllocInfoNegativeTest, InvalidNullPointerMem) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_usm_type_t USMType; ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_NULL_POINTER, @@ -100,6 +116,8 @@ TEST_P(urUSMGetMemAllocInfoNegativeTest, InvalidNullPointerMem) { } TEST_P(urUSMGetMemAllocInfoNegativeTest, InvalidEnumeration) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_usm_type_t USMType; ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_ENUMERATION, @@ -108,6 +126,8 @@ TEST_P(urUSMGetMemAllocInfoNegativeTest, InvalidEnumeration) { } TEST_P(urUSMGetMemAllocInfoNegativeTest, InvalidValuePropSize) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_usm_type_t USMType; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_SIZE, urUSMGetMemAllocInfo(context, ptr, UR_USM_ALLOC_INFO_TYPE, diff --git a/test/conformance/usm/urUSMHostAlloc.cpp b/test/conformance/usm/urUSMHostAlloc.cpp index f59af21897..a583058610 100644 --- a/test/conformance/usm/urUSMHostAlloc.cpp +++ b/test/conformance/usm/urUSMHostAlloc.cpp @@ -6,6 +6,7 @@ #include "helpers.h" #include #include +#include struct urUSMHostAllocTest : uur::urQueueTestWithParam { @@ -44,7 +45,7 @@ struct urUSMHostAllocTest // The 0 value parameters are not relevant for urUSMHostAllocTest tests, they // are used below in urUSMHostAllocAlignmentTest for allocation size and // alignment values -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urUSMHostAllocTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), @@ -52,6 +53,8 @@ UUR_TEST_SUITE_P( uur::printUSMAllocTestString); TEST_P(urUSMHostAllocTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ur_device_usm_access_capability_flags_t hostUSMSupport = 0; ASSERT_SUCCESS(uur::GetDeviceUSMHostSupport(device, hostUSMSupport)); if (!hostUSMSupport) { @@ -126,6 +129,10 @@ TEST_P(urUSMHostAllocTest, InvalidNullPtrMem) { } TEST_P(urUSMHostAllocTest, InvalidUSMSize) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + void *ptr = nullptr; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_USM_SIZE, urUSMHostAlloc(context, nullptr, pool, -1, &ptr)); @@ -142,7 +149,7 @@ TEST_P(urUSMHostAllocTest, InvalidValueAlignPowerOfTwo) { using urUSMHostAllocAlignmentTest = urUSMHostAllocTest; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urUSMHostAllocAlignmentTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), diff --git a/test/conformance/usm/urUSMPoolCreate.cpp b/test/conformance/usm/urUSMPoolCreate.cpp index ac40503eb0..afafa0ff80 100644 --- a/test/conformance/usm/urUSMPoolCreate.cpp +++ b/test/conformance/usm/urUSMPoolCreate.cpp @@ -5,6 +5,7 @@ #include "uur/utils.h" #include +#include struct urUSMPoolCreateTest : uur::urContextTest { void SetUp() { @@ -27,6 +28,8 @@ TEST_P(urUSMPoolCreateTest, Success) { } TEST_P(urUSMPoolCreateTest, SuccessWithFlag) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + ur_usm_pool_desc_t pool_desc{UR_STRUCTURE_TYPE_USM_POOL_DESC, nullptr, UR_USM_POOL_FLAG_ZERO_INITIALIZE_BLOCK}; ur_usm_pool_handle_t pool = nullptr; diff --git a/test/conformance/usm/urUSMPoolGetInfo.cpp b/test/conformance/usm/urUSMPoolGetInfo.cpp index e43bc3a77b..5cf1daa8f2 100644 --- a/test/conformance/usm/urUSMPoolGetInfo.cpp +++ b/test/conformance/usm/urUSMPoolGetInfo.cpp @@ -14,10 +14,10 @@ std::unordered_map pool_info_size_map = { using urUSMPoolGetInfoTestWithInfoParam = uur::urUSMPoolTestWithParam; -UUR_TEST_SUITE_P(urUSMPoolGetInfoTestWithInfoParam, - ::testing::Values(UR_USM_POOL_INFO_CONTEXT, - UR_USM_POOL_INFO_REFERENCE_COUNT), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urUSMPoolGetInfoTestWithInfoParam, + ::testing::Values(UR_USM_POOL_INFO_CONTEXT, + UR_USM_POOL_INFO_REFERENCE_COUNT), + uur::deviceTestWithParamPrinter); TEST_P(urUSMPoolGetInfoTestWithInfoParam, Success) { ur_usm_pool_info_t info_type = getParam(); diff --git a/test/conformance/usm/urUSMSharedAlloc.cpp b/test/conformance/usm/urUSMSharedAlloc.cpp index 021fa6368e..245d2e9889 100644 --- a/test/conformance/usm/urUSMSharedAlloc.cpp +++ b/test/conformance/usm/urUSMSharedAlloc.cpp @@ -5,6 +5,7 @@ #include "helpers.h" #include +#include struct urUSMSharedAllocTest : uur::urQueueTestWithParam { @@ -50,7 +51,7 @@ struct urUSMSharedAllocTest // The 0 value parameters are not relevant for urUSMSharedAllocTest tests, they // are used below in urUSMSharedAllocAlignmentTest for allocation size and // alignment values -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urUSMSharedAllocTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), @@ -140,6 +141,10 @@ TEST_P(urUSMSharedAllocTest, InvalidNullPtrMem) { } TEST_P(urUSMSharedAllocTest, InvalidUSMSize) { + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + UUR_KNOWN_FAILURE_ON(uur::HIP{}); + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_USM_SIZE, urUSMSharedAlloc(context, device, nullptr, pool, -1, &ptr)); @@ -156,7 +161,7 @@ TEST_P(urUSMSharedAllocTest, InvalidValueAlignPowerOfTwo) { using urUSMSharedAllocAlignmentTest = urUSMSharedAllocTest; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urUSMSharedAllocAlignmentTest, testing::Combine( testing::ValuesIn(uur::BoolTestParam::makeBoolParam("UsePool")), diff --git a/test/conformance/usm/usm_adapter_cuda.match b/test/conformance/usm/usm_adapter_cuda.match deleted file mode 100644 index 5460c48661..0000000000 --- a/test/conformance/usm/usm_adapter_cuda.match +++ /dev/null @@ -1,4 +0,0 @@ -{{OPT}}urUSMDeviceAllocTest.InvalidUSMSize/* -{{OPT}}urUSMHostAllocTest.InvalidUSMSize/* -{{OPT}}urUSMPoolCreateTest.SuccessWithFlag/* -{{OPT}}urUSMSharedAllocTest.InvalidUSMSize/* diff --git a/test/conformance/usm/usm_adapter_level_zero.match b/test/conformance/usm/usm_adapter_level_zero.match deleted file mode 100644 index 201c351120..0000000000 --- a/test/conformance/usm/usm_adapter_level_zero.match +++ /dev/null @@ -1 +0,0 @@ -{{OPT}}urUSMDeviceAllocTest.InvalidUSMSize/* diff --git a/test/conformance/usm/usm_adapter_level_zero_v2.match b/test/conformance/usm/usm_adapter_level_zero_v2.match deleted file mode 100644 index ad8e1888d4..0000000000 --- a/test/conformance/usm/usm_adapter_level_zero_v2.match +++ /dev/null @@ -1 +0,0 @@ -urUSMGetMemAllocInfoTest.Success/*___UR_USM_ALLOC_INFO_POOL diff --git a/test/conformance/usm/usm_adapter_native_cpu.match b/test/conformance/usm/usm_adapter_native_cpu.match deleted file mode 100644 index ada1fe040e..0000000000 --- a/test/conformance/usm/usm_adapter_native_cpu.match +++ /dev/null @@ -1,17 +0,0 @@ -urUSMDeviceAllocTest.Success/*__UsePoolDisabled -urUSMDeviceAllocTest.InvalidUSMSize/*__UsePoolDisabled -urUSMFreeTest.SuccessDeviceAlloc/* -urUSMFreeTest.SuccessHostAlloc/* -urUSMFreeTest.SuccessSharedAlloc/* -urUSMFreeDuringExecutionTest.* -urUSMGetMemAllocInfoTest.Success/*__UR_USM_ALLOC_INFO_TYPE -urUSMGetMemAllocInfoTest.Success/*__UR_USM_ALLOC_INFO_BASE_PTR -urUSMGetMemAllocInfoTest.Success/*__UR_USM_ALLOC_INFO_SIZE -urUSMGetMemAllocInfoTest.Success/*__UR_USM_ALLOC_INFO_DEVICE -urUSMGetMemAllocInfoNegativeTest.InvalidNullHandleContext/* -urUSMGetMemAllocInfoNegativeTest.InvalidNullPointerMem/* -urUSMGetMemAllocInfoNegativeTest.InvalidEnumeration/* -urUSMGetMemAllocInfoNegativeTest.InvalidValuePropSize/* -urUSMHostAllocTest.Success/*__UsePoolDisabled -urUSMHostAllocTest.InvalidUSMSize/*__UsePoolDisabled -urUSMSharedAllocTest.InvalidUSMSize/*__UsePoolDisabled diff --git a/test/conformance/virtual_memory/urPhysicalMemCreate.cpp b/test/conformance/virtual_memory/urPhysicalMemCreate.cpp index e7867a8a72..e4a49c44ec 100644 --- a/test/conformance/virtual_memory/urPhysicalMemCreate.cpp +++ b/test/conformance/virtual_memory/urPhysicalMemCreate.cpp @@ -3,7 +3,8 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "uur/fixtures.h" +#include +#include struct urPhysicalMemCreateTest : uur::urVirtualMemGranularityTestWithParam { @@ -26,17 +27,21 @@ struct urPhysicalMemCreateTest }; using urPhysicalMemCreateWithSizeParamTest = urPhysicalMemCreateTest; -UUR_TEST_SUITE_P(urPhysicalMemCreateWithSizeParamTest, - ::testing::Values(1, 2, 3, 7, 12, 44), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urPhysicalMemCreateWithSizeParamTest, + ::testing::Values(1, 2, 3, 7, 12, 44), + uur::deviceTestWithParamPrinter); TEST_P(urPhysicalMemCreateWithSizeParamTest, Success) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + ASSERT_SUCCESS( urPhysicalMemCreate(context, device, size, nullptr, &physical_mem)); ASSERT_NE(physical_mem, nullptr); } TEST_P(urPhysicalMemCreateWithSizeParamTest, InvalidSize) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + if (granularity == 1) { GTEST_SKIP() << "A granularity of 1 means that any size will be accepted."; @@ -49,9 +54,10 @@ TEST_P(urPhysicalMemCreateWithSizeParamTest, InvalidSize) { using urPhysicalMemCreateWithFlagsParamTest = uur::urPhysicalMemTestWithParam; -UUR_TEST_SUITE_P(urPhysicalMemCreateWithFlagsParamTest, - ::testing::Values(UR_PHYSICAL_MEM_FLAG_TBD), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urPhysicalMemCreateWithFlagsParamTest, + ::testing::Values(UR_PHYSICAL_MEM_FLAG_TBD), + uur::deviceTestWithParamPrinter); TEST_P(urPhysicalMemCreateWithFlagsParamTest, Success) { ur_physical_mem_properties_t properties; @@ -65,8 +71,8 @@ TEST_P(urPhysicalMemCreateWithFlagsParamTest, Success) { } using urPhysicalMemCreateTest = urPhysicalMemCreateTest; -UUR_TEST_SUITE_P(urPhysicalMemCreateTest, ::testing::Values(1), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urPhysicalMemCreateTest, ::testing::Values(1), + uur::deviceTestWithParamPrinter); TEST_P(urPhysicalMemCreateTest, InvalidNullHandleContext) { ASSERT_EQ_RESULT( diff --git a/test/conformance/virtual_memory/urPhysicalMemGetInfo.cpp b/test/conformance/virtual_memory/urPhysicalMemGetInfo.cpp index ca2595d0fa..dbf8721529 100644 --- a/test/conformance/virtual_memory/urPhysicalMemGetInfo.cpp +++ b/test/conformance/virtual_memory/urPhysicalMemGetInfo.cpp @@ -3,11 +3,14 @@ // See LICENSE.TXT // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include using urPhysicalMemGetInfoTest = uur::urPhysicalMemTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urPhysicalMemGetInfoTest); TEST_P(urPhysicalMemGetInfoTest, Context) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + size_t info_size = 0; ASSERT_SUCCESS(urPhysicalMemGetInfo( @@ -25,6 +28,8 @@ TEST_P(urPhysicalMemGetInfoTest, Context) { } TEST_P(urPhysicalMemGetInfoTest, Device) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + size_t info_size = 0; ASSERT_SUCCESS(urPhysicalMemGetInfo( @@ -41,6 +46,8 @@ TEST_P(urPhysicalMemGetInfoTest, Device) { } TEST_P(urPhysicalMemGetInfoTest, Size) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); + size_t info_size = 0; ASSERT_SUCCESS(urPhysicalMemGetInfo(physical_mem, UR_PHYSICAL_MEM_INFO_SIZE, @@ -56,6 +63,7 @@ TEST_P(urPhysicalMemGetInfoTest, Size) { } TEST_P(urPhysicalMemGetInfoTest, Properties) { + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); size_t info_size = 0; ASSERT_SUCCESS(urPhysicalMemGetInfo( diff --git a/test/conformance/virtual_memory/urVirtualMemGetInfo.cpp b/test/conformance/virtual_memory/urVirtualMemGetInfo.cpp index 041a749b5b..f3e8a91d32 100644 --- a/test/conformance/virtual_memory/urVirtualMemGetInfo.cpp +++ b/test/conformance/virtual_memory/urVirtualMemGetInfo.cpp @@ -6,9 +6,9 @@ using urVirtualMemGetInfoTestWithParam = uur::urVirtualMemMappedTestWithParam; -UUR_TEST_SUITE_P(urVirtualMemGetInfoTestWithParam, - ::testing::Values(UR_VIRTUAL_MEM_INFO_ACCESS_MODE), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urVirtualMemGetInfoTestWithParam, + ::testing::Values(UR_VIRTUAL_MEM_INFO_ACCESS_MODE), + uur::deviceTestWithParamPrinter); TEST_P(urVirtualMemGetInfoTestWithParam, Success) { size_t info_size = 0; diff --git a/test/conformance/virtual_memory/urVirtualMemGranularityGetInfo.cpp b/test/conformance/virtual_memory/urVirtualMemGranularityGetInfo.cpp index 2fac7a1093..2f8e47d8d1 100644 --- a/test/conformance/virtual_memory/urVirtualMemGranularityGetInfo.cpp +++ b/test/conformance/virtual_memory/urVirtualMemGranularityGetInfo.cpp @@ -7,6 +7,8 @@ struct urVirtualMemGranularityGetInfoTest : uur::urContextTestWithParam { void SetUp() override { + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); + UUR_RETURN_ON_FATAL_FAILURE( urContextTestWithParam::SetUp()); ur_bool_t virtual_memory_support = false; @@ -19,7 +21,7 @@ struct urVirtualMemGranularityGetInfoTest } }; -UUR_TEST_SUITE_P( +UUR_DEVICE_TEST_SUITE_P( urVirtualMemGranularityGetInfoTest, ::testing::Values(UR_VIRTUAL_MEM_GRANULARITY_INFO_MINIMUM, UR_VIRTUAL_MEM_GRANULARITY_INFO_RECOMMENDED), diff --git a/test/conformance/virtual_memory/urVirtualMemMap.cpp b/test/conformance/virtual_memory/urVirtualMemMap.cpp index f6ed600e0a..0133c40c87 100644 --- a/test/conformance/virtual_memory/urVirtualMemMap.cpp +++ b/test/conformance/virtual_memory/urVirtualMemMap.cpp @@ -6,11 +6,12 @@ using urVirtualMemMapWithFlagsTest = uur::urVirtualMemTestWithParam; -UUR_TEST_SUITE_P(urVirtualMemMapWithFlagsTest, - ::testing::Values(UR_VIRTUAL_MEM_ACCESS_FLAG_NONE, - UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE, - UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urVirtualMemMapWithFlagsTest, + ::testing::Values(UR_VIRTUAL_MEM_ACCESS_FLAG_NONE, + UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE, + UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY), + uur::deviceTestWithParamPrinter); TEST_P(urVirtualMemMapWithFlagsTest, Success) { ASSERT_SUCCESS(urVirtualMemMap(context, virtual_ptr, size, physical_mem, 0, diff --git a/test/conformance/virtual_memory/urVirtualMemReserve.cpp b/test/conformance/virtual_memory/urVirtualMemReserve.cpp index 7d870dfb05..7aa67dc9df 100644 --- a/test/conformance/virtual_memory/urVirtualMemReserve.cpp +++ b/test/conformance/virtual_memory/urVirtualMemReserve.cpp @@ -6,10 +6,10 @@ using urVirtualMemReserveTestWithParam = uur::urVirtualMemGranularityTestWithParam; -UUR_TEST_SUITE_P(urVirtualMemReserveTestWithParam, - ::testing::Values(2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, - 2048, 5000, 100000), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P(urVirtualMemReserveTestWithParam, + ::testing::Values(2, 4, 8, 16, 32, 64, 128, 256, 512, + 1024, 2048, 5000, 100000), + uur::deviceTestWithParamPrinter); TEST_P(urVirtualMemReserveTestWithParam, SuccessNoStartPointer) { // round up to nearest granularity diff --git a/test/conformance/virtual_memory/urVirtualMemSetAccess.cpp b/test/conformance/virtual_memory/urVirtualMemSetAccess.cpp index 2010bbd9fc..0585a90b40 100644 --- a/test/conformance/virtual_memory/urVirtualMemSetAccess.cpp +++ b/test/conformance/virtual_memory/urVirtualMemSetAccess.cpp @@ -6,11 +6,12 @@ using urVirtualMemSetAccessWithFlagsTest = uur::urVirtualMemMappedTestWithParam; -UUR_TEST_SUITE_P(urVirtualMemSetAccessWithFlagsTest, - ::testing::Values(UR_VIRTUAL_MEM_ACCESS_FLAG_NONE, - UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE, - UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY), - uur::deviceTestWithParamPrinter); +UUR_DEVICE_TEST_SUITE_P( + urVirtualMemSetAccessWithFlagsTest, + ::testing::Values(UR_VIRTUAL_MEM_ACCESS_FLAG_NONE, + UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE, + UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY), + uur::deviceTestWithParamPrinter); TEST_P(urVirtualMemSetAccessWithFlagsTest, Success) { ASSERT_SUCCESS( diff --git a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero.match b/test/conformance/virtual_memory/virtual_memory_adapter_level_zero.match deleted file mode 100644 index 633aa41f90..0000000000 --- a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero.match +++ /dev/null @@ -1,6 +0,0 @@ -{{OPT}}urPhysicalMemCreateWithSizeParamTest.Success/* -urPhysicalMemCreateWithSizeParamTest.InvalidSize/* -urPhysicalMemGetInfoTest.Context/* -urPhysicalMemGetInfoTest.Device/* -urPhysicalMemGetInfoTest.Size/* -urPhysicalMemGetInfoTest.Properties/* diff --git a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2.match b/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2.match deleted file mode 100644 index 633aa41f90..0000000000 --- a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2.match +++ /dev/null @@ -1,6 +0,0 @@ -{{OPT}}urPhysicalMemCreateWithSizeParamTest.Success/* -urPhysicalMemCreateWithSizeParamTest.InvalidSize/* -urPhysicalMemGetInfoTest.Context/* -urPhysicalMemGetInfoTest.Device/* -urPhysicalMemGetInfoTest.Size/* -urPhysicalMemGetInfoTest.Properties/* diff --git a/test/usm/usmPoolManager.cpp b/test/usm/usmPoolManager.cpp index bdcf402ac2..ad1ca6e093 100644 --- a/test/usm/usmPoolManager.cpp +++ b/test/usm/usmPoolManager.cpp @@ -7,9 +7,9 @@ #include -struct urUsmPoolDescriptorTest - : public uur::urMultiDeviceContextTest, - ::testing::WithParamInterface {}; +using urUsmPoolDescriptorTest = uur::urMultiDeviceContextTest; + +UUR_INSTANTIATE_PLATFORM_TEST_SUITE_P(urUsmPoolDescriptorTest); auto createMockPoolHandle() { static uintptr_t uniqueAddress = 0x1; @@ -20,10 +20,9 @@ auto createMockPoolHandle() { TEST_P(urUsmPoolDescriptorTest, poolIsPerContextTypeAndDevice) { auto &devices = uur::DevicesEnvironment::instance->devices; - auto poolHandle = this->GetParam(); auto [ret, pool_descriptors] = - usm::pool_descriptor::create(poolHandle, this->context); + usm::pool_descriptor::create(nullptr, this->context); ASSERT_EQ(ret, UR_RESULT_SUCCESS); size_t hostPools = 0; @@ -31,7 +30,7 @@ TEST_P(urUsmPoolDescriptorTest, poolIsPerContextTypeAndDevice) { size_t sharedPools = 0; for (auto &desc : pool_descriptors) { - ASSERT_EQ(desc.poolHandle, poolHandle); + ASSERT_EQ(desc.poolHandle, nullptr); ASSERT_EQ(desc.hContext, this->context); if (desc.type == UR_USM_TYPE_DEVICE) { @@ -52,9 +51,6 @@ TEST_P(urUsmPoolDescriptorTest, poolIsPerContextTypeAndDevice) { ASSERT_EQ(sharedPools, devices.size() * 2); } -INSTANTIATE_TEST_SUITE_P(urUsmPoolDescriptorTest, urUsmPoolDescriptorTest, - ::testing::Values(nullptr)); - // TODO: add test with sub-devices struct urUsmPoolManagerTest : public uur::urContextTest { diff --git a/tools/urinfo/urinfo.hpp b/tools/urinfo/urinfo.hpp index 9b052fee39..65c649f178 100644 --- a/tools/urinfo/urinfo.hpp +++ b/tools/urinfo/urinfo.hpp @@ -125,7 +125,7 @@ inline void printDeviceInfos(ur_device_handle_t hDevice, std::cout << prefix; printDeviceInfo(hDevice, UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE); std::cout << prefix; - printDeviceInfo(hDevice, UR_DEVICE_INFO_IMAGE_SUPPORTED); + printDeviceInfo(hDevice, UR_DEVICE_INFO_IMAGE_SUPPORT); std::cout << prefix; printDeviceInfo(hDevice, UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS); std::cout << prefix; @@ -316,7 +316,7 @@ inline void printDeviceInfos(ur_device_handle_t hDevice, printDeviceInfo(hDevice, UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT); std::cout << prefix; printDeviceInfo(hDevice, - UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED); + UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORT); std::cout << prefix; printDeviceInfo(hDevice, UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP); @@ -346,7 +346,8 @@ inline void printDeviceInfos(ur_device_handle_t hDevice, printDeviceInfo(hDevice, UR_DEVICE_INFO_COMMAND_BUFFER_EVENT_SUPPORT_EXP); std::cout << prefix; - printDeviceInfo(hDevice, UR_DEVICE_INFO_CLUSTER_LAUNCH_EXP); + printDeviceInfo(hDevice, + UR_DEVICE_INFO_CLUSTER_LAUNCH_SUPPORT_EXP); std::cout << prefix; printDeviceInfo(hDevice, UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP); @@ -392,19 +393,21 @@ inline void printDeviceInfos(ur_device_handle_t hDevice, hDevice, UR_DEVICE_INFO_CUBEMAP_SEAMLESS_FILTERING_SUPPORT_EXP); std::cout << prefix; printDeviceInfo( - hDevice, UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_EXP); + hDevice, + UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_SUPPORT_EXP); std::cout << prefix; printDeviceInfo( - hDevice, UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_EXP); + hDevice, UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_SUPPORT_EXP); std::cout << prefix; printDeviceInfo( - hDevice, UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_EXP); + hDevice, + UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_SUPPORT_EXP); std::cout << prefix; printDeviceInfo( - hDevice, UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_EXP); + hDevice, UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_SUPPORT_EXP); std::cout << prefix; printDeviceInfo( - hDevice, UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_EXP); + hDevice, UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_SUPPORT_EXP); std::cout << prefix; printDeviceInfo(hDevice, UR_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT_EXP); @@ -412,18 +415,19 @@ inline void printDeviceInfos(ur_device_handle_t hDevice, printDeviceInfo(hDevice, UR_DEVICE_INFO_IMAGE_ARRAY_SUPPORT_EXP); std::cout << prefix; printDeviceInfo( - hDevice, UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_EXP); + hDevice, UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_SUPPORT_EXP); std::cout << prefix; - printDeviceInfo(hDevice, - UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_EXP); + printDeviceInfo( + hDevice, UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_SUPPORT_EXP); std::cout << prefix; - printDeviceInfo(hDevice, - UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_EXP); + printDeviceInfo( + hDevice, UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_SUPPORT_EXP); std::cout << prefix; printDeviceInfo( hDevice, UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP); std::cout << prefix; - printDeviceInfo(hDevice, UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP); + printDeviceInfo(hDevice, + UR_DEVICE_INFO_LOW_POWER_EVENTS_SUPPORT_EXP); std::cout << prefix; printDeviceInfo( hDevice, UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP);