Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package opencl-cpp-headers for openSUSE:Factory checked in at 2022-01-06 15:50:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/opencl-cpp-headers (Old) and /work/SRC/openSUSE:Factory/.opencl-cpp-headers.new.1896 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "opencl-cpp-headers" Thu Jan 6 15:50:48 2022 rev:7 rq:943877 version:2.0.16 Changes: -------- --- /work/SRC/openSUSE:Factory/opencl-cpp-headers/opencl-cpp-headers.changes 2021-07-03 20:51:28.296481360 +0200 +++ /work/SRC/openSUSE:Factory/.opencl-cpp-headers.new.1896/opencl-cpp-headers.changes 2022-01-06 15:50:48.876955815 +0100 @@ -1,0 +2,6 @@ +Tue Jan 4 21:14:46 UTC 2022 - Aaron Puchert <[email protected]> + +- Update to version 2.0.16. + * Synchronize with OpenCL v3.0.10 specification release. + +------------------------------------------------------------------- Old: ---- v2.0.15.tar.gz New: ---- v2.0.16.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ opencl-cpp-headers.spec ++++++ --- /var/tmp/diff_new_pack.wiIORH/_old 2022-01-06 15:50:49.396956101 +0100 +++ /var/tmp/diff_new_pack.wiIORH/_new 2022-01-06 15:50:49.400956103 +0100 @@ -1,8 +1,8 @@ # # spec file for package opencl-cpp-headers # -# Copyright (c) 2021 SUSE LLC -# Copyright (c) 2021 Aaron Puchert. +# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2022 Aaron Puchert. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ Name: opencl-cpp-headers -Version: 2.0.15 +Version: 2.0.16 Release: 0 Summary: OpenCL C++ headers License: Apache-2.0 ++++++ v2.0.15.tar.gz -> v2.0.16.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenCL-CLHPP-2.0.15/.github/workflows/presubmit.yml new/OpenCL-CLHPP-2.0.16/.github/workflows/presubmit.yml --- old/OpenCL-CLHPP-2.0.15/.github/workflows/presubmit.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/OpenCL-CLHPP-2.0.16/.github/workflows/presubmit.yml 2021-11-24 18:02:45.000000000 +0100 @@ -0,0 +1,42 @@ +name: Presubmit +on: [push, pull_request] + +jobs: + build: + name: Build ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Fetch dependencies + run: | + git clone https://github.com/KhronosGroup/OpenCL-Headers.git + cd OpenCL-Headers + ln -s CL OpenCL # For OSX builds + cd .. + git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader.git + - name: Build loader + run: | + export TOP=$(pwd) + cd OpenCL-ICD-Loader + mkdir build + cd build + cmake -DOPENCL_ICD_LOADER_HEADERS_DIR=${TOP}/OpenCL-Headers/ .. + cmake --build . + - name: Build + run: | + export TOP=$(pwd) + mkdir build + cd build + cmake -DOPENCL_LIB_DIR=${TOP}/OpenCL-ICD-Loader/build \ + -DOPENCL_INCLUDE_DIR=${TOP}/OpenCL-Headers \ + .. + cmake --build . + - name: Run tests + run: | + cd build + ctest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenCL-CLHPP-2.0.15/.travis.yml new/OpenCL-CLHPP-2.0.16/.travis.yml --- old/OpenCL-CLHPP-2.0.15/.travis.yml 2021-06-22 17:08:04.000000000 +0200 +++ new/OpenCL-CLHPP-2.0.16/.travis.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,27 +0,0 @@ -language: cpp - -os: - - linux - - osx - -script: - - export TOP=$(pwd) - - git clone https://github.com/KhronosGroup/OpenCL-Headers.git - - cd OpenCL-Headers - - ln -s CL OpenCL # For OSX builds - - cd .. - - git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader.git - - cd ${TOP}/OpenCL-ICD-Loader - - mkdir build - - cd build - - cmake -DOPENCL_ICD_LOADER_HEADERS_DIR=${TOP}/OpenCL-Headers/ .. - - make - - cd ${TOP} - - ls -l - - mkdir build - - cd build - - cmake -DOPENCL_LIB_DIR=${TOP}/OpenCL-ICD-Loader/build - -DOPENCL_INCLUDE_DIR=${TOP}/OpenCL-Headers - .. - - make - - ctest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenCL-CLHPP-2.0.15/README.md new/OpenCL-CLHPP-2.0.16/README.md --- old/OpenCL-CLHPP-2.0.15/README.md 2021-06-22 17:08:04.000000000 +0200 +++ new/OpenCL-CLHPP-2.0.16/README.md 2021-11-24 18:02:45.000000000 +0100 @@ -31,7 +31,7 @@ installation. To get external dependencies needed for testing, use `--recursive` when cloning -the repository, or run `git submodule update --init`. +the repository, or run `git submodule update --init --recursive`. You may need to tell CMake where to find the OpenCL headers and libraries, using the variables `OPENCL_INCLUDE_DIR` and `OPENCL_LIB_DIR`. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenCL-CLHPP-2.0.15/examples/src/headerexample.cpp new/OpenCL-CLHPP-2.0.16/examples/src/headerexample.cpp --- old/OpenCL-CLHPP-2.0.15/examples/src/headerexample.cpp 2021-06-22 17:08:04.000000000 +0200 +++ new/OpenCL-CLHPP-2.0.16/examples/src/headerexample.cpp 2021-11-24 18:02:45.000000000 +0100 @@ -11,28 +11,30 @@ int main(void) { - // Filter for a 2.0 platform and set it as the default + // Filter for a 2.0 or newer platform and set it as the default std::vector<cl::Platform> platforms; cl::Platform::get(&platforms); cl::Platform plat; for (auto &p : platforms) { std::string platver = p.getInfo<CL_PLATFORM_VERSION>(); - if (platver.find("OpenCL 2.") != std::string::npos) { + if (platver.find("OpenCL 2.") != std::string::npos || + platver.find("OpenCL 3.") != std::string::npos) { + // Note: an OpenCL 3.x platform may not support all required features! plat = p; } } if (plat() == 0) { - std::cout << "No OpenCL 2.0 platform found."; + std::cout << "No OpenCL 2.0 or newer platform found.\n"; return -1; } cl::Platform newP = cl::Platform::setDefault(plat); if (newP != plat) { - std::cout << "Error setting default platform."; + std::cout << "Error setting default platform.\n"; return -1; } - // Use C++11 raw string literals for kernel source code + // C++11 raw string literal for the first kernel std::string kernel1{R"CLC( global int globalA; kernel void updateGlobal() @@ -40,6 +42,8 @@ globalA = 75; } )CLC"}; + + // Raw string literal for the second kernel std::string kernel2{R"CLC( typedef struct { global int *bar; } Foo; kernel void vectorAdd(global const Foo* aNum, global const int *inputA, global const int *inputB, @@ -66,7 +70,6 @@ } )CLC"}; - // New simpler string interface style std::vector<std::string> programStrings; programStrings.push_back(kernel1); programStrings.push_back(kernel2); @@ -108,10 +111,9 @@ std::vector<int, cl::SVMAllocator<int, cl::SVMTraitCoarse<>>> inputA(numElements, 1, svmAlloc); cl::coarse_svm_vector<int> inputB(numElements, 2, svmAlloc); - // ////////////// - // Traditional cl_mem allocations + std::vector<int> output(numElements, 0xdeadbeef); cl::Buffer outputBuffer(begin(output), end(output), false); cl::Pipe aPipe(sizeof(cl_int), numElements / 2); @@ -135,8 +137,8 @@ // This one was not passed as a parameter vectorAddKernel.setSVMPointers(anSVMInt); - cl_int error; - vectorAddKernel( + cl_int error; + vectorAddKernel( cl::EnqueueArgs( cl::NDRange(numElements/2), cl::NDRange(numElements/2)), @@ -147,7 +149,7 @@ 3, aPipe, defaultDeviceQueue, - error + error ); cl::copy(outputBuffer, begin(output), end(output)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenCL-CLHPP-2.0.15/include/CL/opencl.hpp new/OpenCL-CLHPP-2.0.16/include/CL/opencl.hpp --- old/OpenCL-CLHPP-2.0.15/include/CL/opencl.hpp 2021-06-22 17:08:04.000000000 +0200 +++ new/OpenCL-CLHPP-2.0.16/include/CL/opencl.hpp 2021-11-24 18:02:45.000000000 +0100 @@ -165,10 +165,6 @@ * the cl::allocate_pointer functions are not defined and may be * defined by the user before opencl.hpp is included. * - * - CL_HPP_ENABLE_DEVICE_FISSION - * - * Enables device fission for OpenCL 1.2 platforms. - * * - CL_HPP_ENABLE_EXCEPTIONS * * Enable exceptions for use in the C++ bindings header. This is the @@ -194,10 +190,22 @@ * applies to use of cl::Program construction and other program * build variants. * + * - CL_HPP_USE_CL_DEVICE_FISSION + * + * Enable the cl_ext_device_fission extension. + * + * - CL_HPP_USE_CL_IMAGE2D_FROM_BUFFER_KHR + * + * Enable the cl_khr_image2d_from_buffer extension. + * * - CL_HPP_USE_CL_SUB_GROUPS_KHR * * Enable the cl_khr_subgroups extension. * + * - CL_HPP_USE_DX_INTEROP + * + * Enable the cl_khr_d3d10_sharing extension. + * * - CL_HPP_USE_IL_KHR * * Enable the cl_khr_il_program extension. @@ -209,6 +217,10 @@ * bindings, including support for the optional exception feature and * also the supplied vector and string classes, see following sections for * decriptions of these features. + * + * Note: the C++ bindings use std::call_once and therefore may need to be + * compiled using special command-line options (such as "-pthread") on some + * platforms! * * \code #define CL_HPP_ENABLE_EXCEPTIONS @@ -224,28 +236,30 @@ int main(void) { - // Filter for a 2.0 platform and set it as the default + // Filter for a 2.0 or newer platform and set it as the default std::vector<cl::Platform> platforms; cl::Platform::get(&platforms); cl::Platform plat; for (auto &p : platforms) { std::string platver = p.getInfo<CL_PLATFORM_VERSION>(); - if (platver.find("OpenCL 2.") != std::string::npos) { + if (platver.find("OpenCL 2.") != std::string::npos || + platver.find("OpenCL 3.") != std::string::npos) { + // Note: an OpenCL 3.x platform may not support all required features! plat = p; } } - if (plat() == 0) { - std::cout << "No OpenCL 2.0 platform found."; + if (plat() == 0) { + std::cout << "No OpenCL 2.0 or newer platform found.\n"; return -1; } cl::Platform newP = cl::Platform::setDefault(plat); if (newP != plat) { - std::cout << "Error setting default platform."; + std::cout << "Error setting default platform.\n"; return -1; } - // Use C++11 raw string literals for kernel source code + // C++11 raw string literal for the first kernel std::string kernel1{R"CLC( global int globalA; kernel void updateGlobal() @@ -253,6 +267,8 @@ globalA = 75; } )CLC"}; + + // Raw string literal for the second kernel std::string kernel2{R"CLC( typedef struct { global int *bar; } Foo; kernel void vectorAdd(global const Foo* aNum, global const int *inputA, global const int *inputB, @@ -279,8 +295,9 @@ } )CLC"}; - // New simpler string interface style - std::vector<std::string> programStrings {kernel1, kernel2}; + std::vector<std::string> programStrings; + programStrings.push_back(kernel1); + programStrings.push_back(kernel2); cl::Program vectorAddProgram(programStrings); try { @@ -319,10 +336,9 @@ std::vector<int, cl::SVMAllocator<int, cl::SVMTraitCoarse<>>> inputA(numElements, 1, svmAlloc); cl::coarse_svm_vector<int> inputB(numElements, 2, svmAlloc); - // ////////////// - // Traditional cl_mem allocations + std::vector<int> output(numElements, 0xdeadbeef); cl::Buffer outputBuffer(begin(output), end(output), false); cl::Pipe aPipe(sizeof(cl_int), numElements / 2); @@ -346,14 +362,8 @@ // This one was not passed as a parameter vectorAddKernel.setSVMPointers(anSVMInt); - // Hand control of coarse allocations to runtime - cl::enqueueUnmapSVM(anSVMInt); - cl::enqueueUnmapSVM(fooPointer); - cl::unmapSVM(inputB); - cl::unmapSVM(output2); - - cl_int error; - vectorAddKernel( + cl_int error; + vectorAddKernel( cl::EnqueueArgs( cl::NDRange(numElements/2), cl::NDRange(numElements/2)), @@ -364,12 +374,10 @@ 3, aPipe, defaultDeviceQueue, - error + error ); cl::copy(outputBuffer, begin(output), end(output)); - // Grab the SVM output vector using a map - cl::mapSVM(output2); cl::Device d = cl::Device::getDefault(); @@ -549,18 +557,25 @@ // Define deprecated prefixes and suffixes to ensure compilation // in case they are not pre-defined #if !defined(CL_API_PREFIX__VERSION_1_1_DEPRECATED) -#define CL_API_PREFIX__VERSION_1_1_DEPRECATED +#define CL_API_PREFIX__VERSION_1_1_DEPRECATED #endif // #if !defined(CL_API_PREFIX__VERSION_1_1_DEPRECATED) #if !defined(CL_API_SUFFIX__VERSION_1_1_DEPRECATED) #define CL_API_SUFFIX__VERSION_1_1_DEPRECATED -#endif // #if !defined(CL_API_PREFIX__VERSION_1_1_DEPRECATED) +#endif // #if !defined(CL_API_SUFFIX__VERSION_1_1_DEPRECATED) #if !defined(CL_API_PREFIX__VERSION_1_2_DEPRECATED) -#define CL_API_PREFIX__VERSION_1_2_DEPRECATED +#define CL_API_PREFIX__VERSION_1_2_DEPRECATED #endif // #if !defined(CL_API_PREFIX__VERSION_1_2_DEPRECATED) #if !defined(CL_API_SUFFIX__VERSION_1_2_DEPRECATED) #define CL_API_SUFFIX__VERSION_1_2_DEPRECATED -#endif // #if !defined(CL_API_PREFIX__VERSION_1_2_DEPRECATED) +#endif // #if !defined(CL_API_SUFFIX__VERSION_1_2_DEPRECATED) + +#if !defined(CL_API_PREFIX__VERSION_2_2_DEPRECATED) +#define CL_API_PREFIX__VERSION_2_2_DEPRECATED +#endif // #if !defined(CL_API_PREFIX__VERSION_2_2_DEPRECATED) +#if !defined(CL_API_SUFFIX__VERSION_2_2_DEPRECATED) +#define CL_API_SUFFIX__VERSION_2_2_DEPRECATED +#endif // #if !defined(CL_API_SUFFIX__VERSION_2_2_DEPRECATED) #if !defined(CL_CALLBACK) #define CL_CALLBACK @@ -1469,7 +1484,7 @@ CL_HPP_PARAM_NAME_INFO_SUBGROUP_KHR_(CL_HPP_DECLARE_PARAM_TRAITS_) #endif // #if defined(CL_HPP_USE_CL_SUB_GROUPS_KHR) && CL_HPP_TARGET_OPENCL_VERSION < 210 -#if defined(CL_HPP_USE_IL_KHR) +#if defined(CL_HPP_USE_IL_KHR) && CL_HPP_TARGET_OPENCL_VERSION < 210 CL_HPP_PARAM_NAME_INFO_IL_KHR_(CL_HPP_DECLARE_PARAM_TRAITS_) #endif // #if defined(CL_HPP_USE_IL_KHR) @@ -1523,7 +1538,11 @@ #if defined(cl_khr_integer_dot_product) CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_INTEGER_DOT_PRODUCT_CAPABILITIES_KHR, cl_device_integer_dot_product_capabilities_khr) -#endif +#if defined(CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT_KHR) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT_KHR, cl_device_integer_dot_product_acceleration_properties_khr) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_4x8BIT_PACKED_KHR, cl_device_integer_dot_product_acceleration_properties_khr) +#endif // defined(CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT_KHR) +#endif // defined(cl_khr_integer_dot_product) #ifdef CL_PLATFORM_ICD_SUFFIX_KHR CL_HPP_DECLARE_PARAM_TRAITS_(cl_platform_info, CL_PLATFORM_ICD_SUFFIX_KHR, string) @@ -1562,6 +1581,9 @@ #ifdef CL_DEVICE_LOCAL_MEM_BANKS_AMD CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_LOCAL_MEM_BANKS_AMD, cl_uint) #endif +#ifdef CL_DEVICE_BOARD_NAME_AMD +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_BOARD_NAME_AMD, string) +#endif #ifdef CL_DEVICE_COMPUTE_UNITS_BITFIELD_ARM CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_COMPUTE_UNITS_BITFIELD_ARM, cl_ulong) @@ -1572,6 +1594,9 @@ #ifdef CL_DEVICE_SCHEDULING_CONTROLS_CAPABILITIES_ARM CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_SCHEDULING_CONTROLS_CAPABILITIES_ARM, cl_bitfield) #endif +#ifdef CL_DEVICE_SUPPORTED_REGISTER_ALLOCATIONS_ARM +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_SUPPORTED_REGISTER_ALLOCATIONS_ARM, vector<cl_uint>) +#endif #ifdef CL_KERNEL_EXEC_INFO_WORKGROUP_BATCH_SIZE_ARM CL_HPP_DECLARE_PARAM_TRAITS_(cl_kernel_exec_info, CL_KERNEL_EXEC_INFO_WORKGROUP_BATCH_SIZE_ARM, cl_uint) #endif @@ -6424,8 +6449,7 @@ static PFN_clCreateProgramWithILKHR pfn_clCreateProgramWithILKHR = NULL; CL_HPP_INIT_CL_EXT_FCN_PTR_(clCreateProgramWithILKHR); - return detail::errHandler( - pfn_clCreateProgramWithILKHR( + object_ = pfn_clCreateProgramWithILKHR( context(), static_cast<const void*>(IL.data()), IL.size(), &error); #endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 210 @@ -6478,8 +6502,7 @@ static PFN_clCreateProgramWithILKHR pfn_clCreateProgramWithILKHR = NULL; CL_HPP_INIT_CL_EXT_FCN_PTR_(clCreateProgramWithILKHR); - return detail::errHandler( - pfn_clCreateProgramWithILKHR( + object_ = pfn_clCreateProgramWithILKHR( context(), static_cast<const void*>(IL.data()), IL.size(), &error); #endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 210 @@ -9320,7 +9343,7 @@ */ template<typename T, class D> inline cl_int enqueueMapSVM( - cl::pointer<T, D> ptr, + cl::pointer<T, D> &ptr, cl_bool blocking, cl_map_flags flags, size_type size, @@ -9344,7 +9367,7 @@ */ template<typename T, class Alloc> inline cl_int enqueueMapSVM( - cl::vector<T, Alloc> container, + cl::vector<T, Alloc> &container, cl_bool blocking, cl_map_flags flags, const vector<Event>* events = NULL, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenCL-CLHPP-2.0.15/tests/CMakeLists.txt new/OpenCL-CLHPP-2.0.16/tests/CMakeLists.txt --- old/OpenCL-CLHPP-2.0.15/tests/CMakeLists.txt 2021-06-22 17:08:04.000000000 +0200 +++ new/OpenCL-CLHPP-2.0.16/tests/CMakeLists.txt 2021-11-24 18:02:45.000000000 +0100 @@ -58,11 +58,22 @@ # TODO enable testing for OpenCL 1.0 and 1.1 foreach(VERSION 120 200 210 220 300) - set(TEST_EXE test_openclhpp_${VERSION}) - add_executable(${TEST_EXE} ${TEST_SOURCES} ${TEST_HEADERS}) - target_compile_definitions(${TEST_EXE} - PUBLIC -DCL_HPP_TARGET_OPENCL_VERSION=${VERSION} - ) - add_test(NAME ${TEST_EXE} COMMAND ${TEST_EXE}) + foreach(OPTION "" CL_HPP_ENABLE_EXCEPTIONS CL_HPP_ENABLE_SIZE_T_COMPATIBILITY CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY CL_HPP_CL_1_2_DEFAULT_BUILD CL_HPP_USE_CL_DEVICE_FISSION CL_HPP_USE_CL_IMAGE2D_FROM_BUFFER_KHR CL_HPP_USE_CL_SUB_GROUPS_KHR CL_HPP_USE_IL_KHR) + if(OPTION STREQUAL "") + # The empty string means we're not setting any special option. + set(UNDERSCORE_OPTION "${OPTION}") + set(DEFINE_OPTION "") + else() + set(UNDERSCORE_OPTION "_${OPTION}") + set(DEFINE_OPTION "-D${OPTION}") + endif() + + set(TEST_EXE test_openclhpp_${VERSION}${UNDERSCORE_OPTION}) + add_executable(${TEST_EXE} ${TEST_SOURCES} ${TEST_HEADERS}) + target_compile_definitions(${TEST_EXE} + PUBLIC -DCL_HPP_TARGET_OPENCL_VERSION=${VERSION} ${DEFINE_OPTION} + ) + add_test(NAME ${TEST_EXE} COMMAND ${TEST_EXE}) + endforeach(OPTION) endforeach(VERSION) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenCL-CLHPP-2.0.15/tests/cmock.yml new/OpenCL-CLHPP-2.0.16/tests/cmock.yml --- old/OpenCL-CLHPP-2.0.15/tests/cmock.yml 2021-06-22 17:08:04.000000000 +0200 +++ new/OpenCL-CLHPP-2.0.16/tests/cmock.yml 2021-11-24 18:02:45.000000000 +0100 @@ -7,3 +7,5 @@ - CL_API_CALL :plugins: - :callback + :treat_as: + 'void*': 'PTR' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenCL-CLHPP-2.0.15/tests/test_openclhpp.cpp new/OpenCL-CLHPP-2.0.16/tests/test_openclhpp.cpp --- old/OpenCL-CLHPP-2.0.15/tests/test_openclhpp.cpp 2021-06-22 17:08:04.000000000 +0200 +++ new/OpenCL-CLHPP-2.0.16/tests/test_openclhpp.cpp 2021-11-24 18:02:45.000000000 +0100 @@ -1,5 +1,4 @@ #define CL_HPP_UNIT_TEST_ENABLE -#define CL_HPP_USE_CL_SUB_GROUPS_KHR // We want to support all versions #define CL_HPP_MINIMUM_OPENCL_VERSION 100 @@ -571,6 +570,8 @@ TEST_ASSERT_EQUAL(CL_CONTEXT_PLATFORM, properties[0]); TEST_ASSERT_EQUAL(make_platform_id(1), properties[1]); #endif + if (errcode_ret) + *errcode_ret = CL_SUCCESS; return make_context(0); } @@ -627,6 +628,8 @@ for (int i = 0; i < num_devices; i++) { TEST_ASSERT_EQUAL(make_device_id(i), devices[i]); } + if (errcode_ret != NULL) + *errcode_ret = CL_SUCCESS; return make_context(0); } @@ -769,6 +772,8 @@ TEST_ASSERT_EQUAL_PTR(make_context(0), context); TEST_ASSERT_EQUAL_PTR(make_device_id(0), device); TEST_ASSERT(properties == 0); + if (errcode_ret != NULL) + *errcode_ret = CL_SUCCESS; return make_command_queue(0); } @@ -786,6 +791,8 @@ TEST_ASSERT_EQUAL_PTR(make_device_id(0), device); TEST_ASSERT(properties[0] == CL_QUEUE_PROPERTIES); TEST_ASSERT(properties[1] == 0); + if (errcode_ret != NULL) + *errcode_ret = CL_SUCCESS; return make_command_queue(0); } #endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 @@ -1080,7 +1087,7 @@ TEST_ASSERT_EQUAL(sizeof(int)*1024, size); TEST_ASSERT_NULL(host_ptr); if (errcode_ret) - errcode_ret = CL_SUCCESS; + *errcode_ret = CL_SUCCESS; return make_mem(0); } @@ -1303,6 +1310,9 @@ TEST_ASSERT_NOT_NULL(image_desc); TEST_ASSERT_EQUAL_HEX(CL_MEM_OBJECT_IMAGE1D_BUFFER, image_desc->image_type); + if (errcode_ret != NULL) + *errcode_ret = CL_SUCCESS; + // Return the passed buffer as the cl_mem return image_desc->buffer; } @@ -2204,6 +2214,9 @@ TEST_ASSERT_EQUAL(properties[0], CL_QUEUE_PROPERTIES); static cl_command_queue default_ = 0; + if (errcode_ret != NULL) + *errcode_ret = CL_SUCCESS; + if ((properties[1] & CL_QUEUE_ON_DEVICE_DEFAULT) == 0) { TEST_ASSERT_EQUAL(properties[1], (CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE)); if (properties[2] == CL_QUEUE_SIZE) { @@ -2426,13 +2439,14 @@ */ static cl_kernel clCloneKernel_simplecopy( cl_kernel k, - cl_int *err, + cl_int *errcode_ret, int num_calls) { // Test to verify case where empty string is returned - so size is 0 (void)num_calls; + if (errcode_ret != NULL) + *errcode_ret = CL_SUCCESS; return make_kernel(POOL_MAX); - return CL_SUCCESS; } void testCloneKernel() @@ -2454,6 +2468,17 @@ #endif } +void testMapSVM() +{ +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + std::vector<int> vec(1); + clRetainCommandQueue_ExpectAndReturn(make_command_queue(1), CL_SUCCESS); + clEnqueueSVMMap_ExpectAndReturn(make_command_queue(1), CL_TRUE, CL_MAP_READ|CL_MAP_WRITE, static_cast<void*>(vec.data()), vec.size()*sizeof(int), 0, NULL, NULL, CL_SUCCESS); + clReleaseCommandQueue_ExpectAndReturn(make_command_queue(1), CL_SUCCESS); + TEST_ASSERT_EQUAL(cl::mapSVM(vec), CL_SUCCESS); +#endif +} + // Run after other tests to clear the default state in the header // using special unit test bypasses. // We cannot remove the once_flag, so this is a hard fix
