diff --git a/test/conformance/enqueue/helpers.h b/test/conformance/enqueue/helpers.h index 275a13e458..03b34135a7 100644 --- a/test/conformance/enqueue/helpers.h +++ b/test/conformance/enqueue/helpers.h @@ -101,6 +101,25 @@ struct mem_buffer_test_parameters_t { ur_mem_flag_t mem_flag; }; +static std::vector mem_buffer_test_parameters{ + {1024, UR_MEM_FLAG_READ_WRITE}, + {2500, UR_MEM_FLAG_READ_WRITE}, + {4096, UR_MEM_FLAG_READ_WRITE}, + {6000, UR_MEM_FLAG_READ_WRITE}, + {1024, UR_MEM_FLAG_WRITE_ONLY}, + {2500, UR_MEM_FLAG_WRITE_ONLY}, + {4096, UR_MEM_FLAG_WRITE_ONLY}, + {6000, UR_MEM_FLAG_WRITE_ONLY}, + {1024, UR_MEM_FLAG_READ_ONLY}, + {2500, UR_MEM_FLAG_READ_ONLY}, + {4096, UR_MEM_FLAG_READ_ONLY}, + {6000, UR_MEM_FLAG_READ_ONLY}, + {1024, UR_MEM_FLAG_ALLOC_HOST_POINTER}, + {2500, UR_MEM_FLAG_ALLOC_HOST_POINTER}, + {4096, UR_MEM_FLAG_ALLOC_HOST_POINTER}, + {6000, UR_MEM_FLAG_ALLOC_HOST_POINTER}, +}; + struct mem_buffer_map_write_test_parameters_t { size_t count; ur_mem_flag_t mem_flag; diff --git a/test/conformance/enqueue/urEnqueueMemBufferMap.cpp b/test/conformance/enqueue/urEnqueueMemBufferMap.cpp index 7fc848a0ef..06b348e218 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferMap.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferMap.cpp @@ -8,27 +8,9 @@ using urEnqueueMemBufferMapTestWithParam = uur::urMemBufferQueueTestWithParam; -static std::vector test_parameters{ - {1024, UR_MEM_FLAG_READ_WRITE}, - {2500, UR_MEM_FLAG_READ_WRITE}, - {4096, UR_MEM_FLAG_READ_WRITE}, - {6000, UR_MEM_FLAG_READ_WRITE}, - {1024, UR_MEM_FLAG_WRITE_ONLY}, - {2500, UR_MEM_FLAG_WRITE_ONLY}, - {4096, UR_MEM_FLAG_WRITE_ONLY}, - {6000, UR_MEM_FLAG_WRITE_ONLY}, - {1024, UR_MEM_FLAG_READ_ONLY}, - {2500, UR_MEM_FLAG_READ_ONLY}, - {4096, UR_MEM_FLAG_READ_ONLY}, - {6000, UR_MEM_FLAG_READ_ONLY}, - {1024, UR_MEM_FLAG_ALLOC_HOST_POINTER}, - {2500, UR_MEM_FLAG_ALLOC_HOST_POINTER}, - {4096, UR_MEM_FLAG_ALLOC_HOST_POINTER}, - {6000, UR_MEM_FLAG_ALLOC_HOST_POINTER}, -}; - UUR_TEST_SUITE_P( - urEnqueueMemBufferMapTestWithParam, ::testing::ValuesIn(test_parameters), + urEnqueueMemBufferMapTestWithParam, + ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); TEST_P(urEnqueueMemBufferMapTestWithParam, SuccessRead) { diff --git a/test/conformance/enqueue/urEnqueueMemBufferRead.cpp b/test/conformance/enqueue/urEnqueueMemBufferRead.cpp index 70f4b5370b..5c36ffc11c 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferRead.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferRead.cpp @@ -8,27 +8,9 @@ using urEnqueueMemBufferReadTestWithParam = uur::urMemBufferQueueTestWithParam; -static std::vector test_parameters{ - {1024, UR_MEM_FLAG_READ_WRITE}, - {2500, UR_MEM_FLAG_READ_WRITE}, - {4096, UR_MEM_FLAG_READ_WRITE}, - {6000, UR_MEM_FLAG_READ_WRITE}, - {1024, UR_MEM_FLAG_WRITE_ONLY}, - {2500, UR_MEM_FLAG_WRITE_ONLY}, - {4096, UR_MEM_FLAG_WRITE_ONLY}, - {6000, UR_MEM_FLAG_WRITE_ONLY}, - {1024, UR_MEM_FLAG_READ_ONLY}, - {2500, UR_MEM_FLAG_READ_ONLY}, - {4096, UR_MEM_FLAG_READ_ONLY}, - {6000, UR_MEM_FLAG_READ_ONLY}, - {1024, UR_MEM_FLAG_ALLOC_HOST_POINTER}, - {2500, UR_MEM_FLAG_ALLOC_HOST_POINTER}, - {4096, UR_MEM_FLAG_ALLOC_HOST_POINTER}, - {6000, UR_MEM_FLAG_ALLOC_HOST_POINTER}, -}; - UUR_TEST_SUITE_P( - urEnqueueMemBufferReadTestWithParam, ::testing::ValuesIn(test_parameters), + urEnqueueMemBufferReadTestWithParam, + ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); TEST_P(urEnqueueMemBufferReadTestWithParam, Success) { diff --git a/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp b/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp index c64be4c5db..c5ac53f14a 100644 --- a/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp +++ b/test/conformance/enqueue/urEnqueueMemBufferWrite.cpp @@ -8,27 +8,9 @@ using urEnqueueMemBufferWriteTestWithParam = uur::urMemBufferQueueTestWithParam; -static std::vector test_parameters{ - {1024, UR_MEM_FLAG_READ_WRITE}, - {2500, UR_MEM_FLAG_READ_WRITE}, - {4096, UR_MEM_FLAG_READ_WRITE}, - {6000, UR_MEM_FLAG_READ_WRITE}, - {1024, UR_MEM_FLAG_WRITE_ONLY}, - {2500, UR_MEM_FLAG_WRITE_ONLY}, - {4096, UR_MEM_FLAG_WRITE_ONLY}, - {6000, UR_MEM_FLAG_WRITE_ONLY}, - {1024, UR_MEM_FLAG_READ_ONLY}, - {2500, UR_MEM_FLAG_READ_ONLY}, - {4096, UR_MEM_FLAG_READ_ONLY}, - {6000, UR_MEM_FLAG_READ_ONLY}, - {1024, UR_MEM_FLAG_ALLOC_HOST_POINTER}, - {2500, UR_MEM_FLAG_ALLOC_HOST_POINTER}, - {4096, UR_MEM_FLAG_ALLOC_HOST_POINTER}, - {6000, UR_MEM_FLAG_ALLOC_HOST_POINTER}, -}; - UUR_TEST_SUITE_P( - urEnqueueMemBufferWriteTestWithParam, ::testing::ValuesIn(test_parameters), + urEnqueueMemBufferWriteTestWithParam, + ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); TEST_P(urEnqueueMemBufferWriteTestWithParam, Success) { diff --git a/test/conformance/enqueue/urEnqueueMemUnmap.cpp b/test/conformance/enqueue/urEnqueueMemUnmap.cpp index bf6ed77b85..41b604abeb 100644 --- a/test/conformance/enqueue/urEnqueueMemUnmap.cpp +++ b/test/conformance/enqueue/urEnqueueMemUnmap.cpp @@ -24,27 +24,8 @@ struct urEnqueueMemUnmapTestWithParam uint32_t *map = nullptr; }; -static std::vector test_parameters{ - {1024, UR_MEM_FLAG_READ_WRITE}, - {2500, UR_MEM_FLAG_READ_WRITE}, - {4096, UR_MEM_FLAG_READ_WRITE}, - {6000, UR_MEM_FLAG_READ_WRITE}, - {1024, UR_MEM_FLAG_WRITE_ONLY}, - {2500, UR_MEM_FLAG_WRITE_ONLY}, - {4096, UR_MEM_FLAG_WRITE_ONLY}, - {6000, UR_MEM_FLAG_WRITE_ONLY}, - {1024, UR_MEM_FLAG_READ_ONLY}, - {2500, UR_MEM_FLAG_READ_ONLY}, - {4096, UR_MEM_FLAG_READ_ONLY}, - {6000, UR_MEM_FLAG_READ_ONLY}, - {1024, UR_MEM_FLAG_ALLOC_HOST_POINTER}, - {2500, UR_MEM_FLAG_ALLOC_HOST_POINTER}, - {4096, UR_MEM_FLAG_ALLOC_HOST_POINTER}, - {6000, UR_MEM_FLAG_ALLOC_HOST_POINTER}, -}; - UUR_TEST_SUITE_P(urEnqueueMemUnmapTestWithParam, - ::testing::ValuesIn(test_parameters), + ::testing::ValuesIn(uur::mem_buffer_test_parameters), uur::printMemBufferTestString); TEST_P(urEnqueueMemUnmapTestWithParam, Success) {