Re: [Piglit] [PATCH v2] cl: add clLinkProgram test
On Tue, 2015-01-06 at 21:20 +0100, EdB wrote: I don't have commit acces. Can someone push it? I think you need to update tests/cl.py before this can be pushed. Le 2014-12-19 20:41, Tom Stellard a écrit : On Fri, Dec 19, 2014 at 02:39:06PM +0100, EdB wrote: v2: Use piglit_cl_get_program_build_info instead of piglit_cl_get_program_info, I was expected it to fail so I didn't paid attention. Remove -invalid- --link-- options on CL_INVALID_OPERATION test. Reviewed-by: Tom Stellard thomas.stell...@amd.com --- tests/cl/api/CMakeLists.cl.txt | 1 + tests/cl/api/link-program.c| 394 + 2 files changed, 395 insertions(+) create mode 100644 tests/cl/api/link-program.c diff --git a/tests/cl/api/CMakeLists.cl.txt b/tests/cl/api/CMakeLists.cl.txt index 7e78491..b598528 100644 --- a/tests/cl/api/CMakeLists.cl.txt +++ b/tests/cl/api/CMakeLists.cl.txt @@ -31,6 +31,7 @@ piglit_cl_add_api_test (create-program-with-source create-program-with-source.c) piglit_cl_add_api_test (retain_release-program retain_release-program.c) piglit_cl_add_api_test (build-program build-program.c) piglit_cl_add_api_test (compile-program compile-program.c) +piglit_cl_add_api_test (link-program link-program.c) piglit_cl_add_api_test (unload-compiler unload-compiler.c) piglit_cl_add_api_test (get-program-info get-program-info.c) piglit_cl_add_api_test (get-program-build-info get-program-build-info.c) diff --git a/tests/cl/api/link-program.c b/tests/cl/api/link-program.c new file mode 100644 index 000..e98f428 --- /dev/null +++ b/tests/cl/api/link-program.c @@ -0,0 +1,394 @@ +/* + * Copyright © 2014 EdB edb+pig...@sigluy.net + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the Software), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * @file link-program.c + * + * Test API function: + * + * cl_program + * clLinkProgram(cl_context context, + * cl_uint num_devices, const cl_device_id device_list, + * const char *options, + * cl_uint num_input_programs, const cl_program *input_programs, + * void (CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), + * void *user_data, + * cl_int *errcode_ret) + */ + +#include piglit-framework-cl-api.h + + +PIGLIT_CL_API_TEST_CONFIG_BEGIN + + config.name = clLinkProgram; + config.version_min = 12; + + config.run_per_platform = true; + config.create_context = true; + +PIGLIT_CL_API_TEST_CONFIG_END + + +const char* strings[] = { + int get_number() { return 42; }, + int get_number();\n, + kernel void test_kernel() { int i = get_number(); }, + int get_number() { return 0; } +}; + +#if defined(CL_VERSION_1_2) +static cl_program +compile_program(cl_context context, +cl_uint num_devices, const cl_device_id *device_list, +cl_uint count, const char **strings, +const char* err_str) { + cl_int errNo; + cl_program program; + + /* Create program with source */ + program = clCreateProgramWithSource(context, + count, + strings, + NULL, + errNo); + if(!piglit_cl_check_error(errNo, CL_SUCCESS)) { + fprintf(stderr, + Failed (error code: %s): Create program with source (for the %s).\n, + piglit_cl_get_error_name(errNo), err_str); + return NULL; + } + + /* Compile program */ + errNo = clCompileProgram(program, +
Re: [Piglit] [PATCH v2] cl: add clLinkProgram test
I don't have commit acces. Can someone push it? Le 2014-12-19 20:41, Tom Stellard a écrit : On Fri, Dec 19, 2014 at 02:39:06PM +0100, EdB wrote: v2: Use piglit_cl_get_program_build_info instead of piglit_cl_get_program_info, I was expected it to fail so I didn't paid attention. Remove -invalid- --link-- options on CL_INVALID_OPERATION test. Reviewed-by: Tom Stellard thomas.stell...@amd.com --- tests/cl/api/CMakeLists.cl.txt | 1 + tests/cl/api/link-program.c| 394 + 2 files changed, 395 insertions(+) create mode 100644 tests/cl/api/link-program.c diff --git a/tests/cl/api/CMakeLists.cl.txt b/tests/cl/api/CMakeLists.cl.txt index 7e78491..b598528 100644 --- a/tests/cl/api/CMakeLists.cl.txt +++ b/tests/cl/api/CMakeLists.cl.txt @@ -31,6 +31,7 @@ piglit_cl_add_api_test (create-program-with-source create-program-with-source.c) piglit_cl_add_api_test (retain_release-program retain_release-program.c) piglit_cl_add_api_test (build-program build-program.c) piglit_cl_add_api_test (compile-program compile-program.c) +piglit_cl_add_api_test (link-program link-program.c) piglit_cl_add_api_test (unload-compiler unload-compiler.c) piglit_cl_add_api_test (get-program-info get-program-info.c) piglit_cl_add_api_test (get-program-build-info get-program-build-info.c) diff --git a/tests/cl/api/link-program.c b/tests/cl/api/link-program.c new file mode 100644 index 000..e98f428 --- /dev/null +++ b/tests/cl/api/link-program.c @@ -0,0 +1,394 @@ +/* + * Copyright © 2014 EdB edb+pig...@sigluy.net + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the Software), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * @file link-program.c + * + * Test API function: + * + * cl_program + * clLinkProgram(cl_context context, + * cl_uint num_devices, const cl_device_id device_list, + * const char *options, + * cl_uint num_input_programs, const cl_program *input_programs, + * void (CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), + * void *user_data, + * cl_int *errcode_ret) + */ + +#include piglit-framework-cl-api.h + + +PIGLIT_CL_API_TEST_CONFIG_BEGIN + + config.name = clLinkProgram; + config.version_min = 12; + + config.run_per_platform = true; + config.create_context = true; + +PIGLIT_CL_API_TEST_CONFIG_END + + +const char* strings[] = { + int get_number() { return 42; }, + int get_number();\n, + kernel void test_kernel() { int i = get_number(); }, + int get_number() { return 0; } +}; + +#if defined(CL_VERSION_1_2) +static cl_program +compile_program(cl_context context, +cl_uint num_devices, const cl_device_id *device_list, +cl_uint count, const char **strings, +const char* err_str) { + cl_int errNo; + cl_program program; + + /* Create program with source */ + program = clCreateProgramWithSource(context, + count, + strings, + NULL, + errNo); + if(!piglit_cl_check_error(errNo, CL_SUCCESS)) { + fprintf(stderr, + Failed (error code: %s): Create program with source (for the %s).\n, + piglit_cl_get_error_name(errNo), err_str); + return NULL; + } + + /* Compile program */ + errNo = clCompileProgram(program, + num_devices, device_list, + , + 0, NULL, NULL, + NULL, NULL); + + if(!piglit_cl_check_error(errNo, CL_SUCCESS)) { + fprintf(stderr, Failed (error code: %s): Compile program (for the %s).\n, + piglit_cl_get_error_name(errNo), err_str); +
[Piglit] [PATCH v2] cl: add clLinkProgram test
v2: Use piglit_cl_get_program_build_info instead of piglit_cl_get_program_info, I was expected it to fail so I didn't paid attention. Remove -invalid- --link-- options on CL_INVALID_OPERATION test. --- tests/cl/api/CMakeLists.cl.txt | 1 + tests/cl/api/link-program.c| 394 + 2 files changed, 395 insertions(+) create mode 100644 tests/cl/api/link-program.c diff --git a/tests/cl/api/CMakeLists.cl.txt b/tests/cl/api/CMakeLists.cl.txt index 7e78491..b598528 100644 --- a/tests/cl/api/CMakeLists.cl.txt +++ b/tests/cl/api/CMakeLists.cl.txt @@ -31,6 +31,7 @@ piglit_cl_add_api_test (create-program-with-source create-program-with-source.c) piglit_cl_add_api_test (retain_release-program retain_release-program.c) piglit_cl_add_api_test (build-program build-program.c) piglit_cl_add_api_test (compile-program compile-program.c) +piglit_cl_add_api_test (link-program link-program.c) piglit_cl_add_api_test (unload-compiler unload-compiler.c) piglit_cl_add_api_test (get-program-info get-program-info.c) piglit_cl_add_api_test (get-program-build-info get-program-build-info.c) diff --git a/tests/cl/api/link-program.c b/tests/cl/api/link-program.c new file mode 100644 index 000..e98f428 --- /dev/null +++ b/tests/cl/api/link-program.c @@ -0,0 +1,394 @@ +/* + * Copyright © 2014 EdB edb+pig...@sigluy.net + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the Software), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * @file link-program.c + * + * Test API function: + * + * cl_program + * clLinkProgram(cl_context context, + * cl_uint num_devices, const cl_device_id device_list, + * const char *options, + * cl_uint num_input_programs, const cl_program *input_programs, + * void (CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), + * void *user_data, + * cl_int *errcode_ret) + */ + +#include piglit-framework-cl-api.h + + +PIGLIT_CL_API_TEST_CONFIG_BEGIN + + config.name = clLinkProgram; + config.version_min = 12; + + config.run_per_platform = true; + config.create_context = true; + +PIGLIT_CL_API_TEST_CONFIG_END + + +const char* strings[] = { + int get_number() { return 42; }, + int get_number();\n, + kernel void test_kernel() { int i = get_number(); }, + int get_number() { return 0; } +}; + +#if defined(CL_VERSION_1_2) +static cl_program +compile_program(cl_context context, +cl_uint num_devices, const cl_device_id *device_list, +cl_uint count, const char **strings, +const char* err_str) { + cl_int errNo; + cl_program program; + + /* Create program with source */ + program = clCreateProgramWithSource(context, + count, + strings, + NULL, + errNo); + if(!piglit_cl_check_error(errNo, CL_SUCCESS)) { + fprintf(stderr, + Failed (error code: %s): Create program with source (for the %s).\n, + piglit_cl_get_error_name(errNo), err_str); + return NULL; + } + + /* Compile program */ + errNo = clCompileProgram(program, + num_devices, device_list, + , + 0, NULL, NULL, + NULL, NULL); + + if(!piglit_cl_check_error(errNo, CL_SUCCESS)) { + fprintf(stderr, Failed (error code: %s): Compile program (for the %s).\n, + piglit_cl_get_error_name(errNo), err_str); + clReleaseProgram(program); + return NULL; + } + + return program; +} + +static bool +test(cl_context context, + cl_uint num_devices, const cl_device_id *device_list, + const char *options,
Re: [Piglit] [PATCH v2] cl: add clLinkProgram test
On Fri, Dec 19, 2014 at 02:39:06PM +0100, EdB wrote: v2: Use piglit_cl_get_program_build_info instead of piglit_cl_get_program_info, I was expected it to fail so I didn't paid attention. Remove -invalid- --link-- options on CL_INVALID_OPERATION test. Reviewed-by: Tom Stellard thomas.stell...@amd.com --- tests/cl/api/CMakeLists.cl.txt | 1 + tests/cl/api/link-program.c| 394 + 2 files changed, 395 insertions(+) create mode 100644 tests/cl/api/link-program.c diff --git a/tests/cl/api/CMakeLists.cl.txt b/tests/cl/api/CMakeLists.cl.txt index 7e78491..b598528 100644 --- a/tests/cl/api/CMakeLists.cl.txt +++ b/tests/cl/api/CMakeLists.cl.txt @@ -31,6 +31,7 @@ piglit_cl_add_api_test (create-program-with-source create-program-with-source.c) piglit_cl_add_api_test (retain_release-program retain_release-program.c) piglit_cl_add_api_test (build-program build-program.c) piglit_cl_add_api_test (compile-program compile-program.c) +piglit_cl_add_api_test (link-program link-program.c) piglit_cl_add_api_test (unload-compiler unload-compiler.c) piglit_cl_add_api_test (get-program-info get-program-info.c) piglit_cl_add_api_test (get-program-build-info get-program-build-info.c) diff --git a/tests/cl/api/link-program.c b/tests/cl/api/link-program.c new file mode 100644 index 000..e98f428 --- /dev/null +++ b/tests/cl/api/link-program.c @@ -0,0 +1,394 @@ +/* + * Copyright © 2014 EdB edb+pig...@sigluy.net + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the Software), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * @file link-program.c + * + * Test API function: + * + * cl_program + * clLinkProgram(cl_context context, + * cl_uint num_devices, const cl_device_id device_list, + * const char *options, + * cl_uint num_input_programs, const cl_program *input_programs, + * void (CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), + * void *user_data, + * cl_int *errcode_ret) + */ + +#include piglit-framework-cl-api.h + + +PIGLIT_CL_API_TEST_CONFIG_BEGIN + + config.name = clLinkProgram; + config.version_min = 12; + + config.run_per_platform = true; + config.create_context = true; + +PIGLIT_CL_API_TEST_CONFIG_END + + +const char* strings[] = { + int get_number() { return 42; }, + int get_number();\n, + kernel void test_kernel() { int i = get_number(); }, + int get_number() { return 0; } +}; + +#if defined(CL_VERSION_1_2) +static cl_program +compile_program(cl_context context, +cl_uint num_devices, const cl_device_id *device_list, +cl_uint count, const char **strings, +const char* err_str) { + cl_int errNo; + cl_program program; + + /* Create program with source */ + program = clCreateProgramWithSource(context, + count, + strings, + NULL, + errNo); + if(!piglit_cl_check_error(errNo, CL_SUCCESS)) { + fprintf(stderr, + Failed (error code: %s): Create program with source (for the %s).\n, + piglit_cl_get_error_name(errNo), err_str); + return NULL; + } + + /* Compile program */ + errNo = clCompileProgram(program, +num_devices, device_list, + , +0, NULL, NULL, +NULL, NULL); + + if(!piglit_cl_check_error(errNo, CL_SUCCESS)) { + fprintf(stderr, Failed (error code: %s): Compile program (for the %s).\n, + piglit_cl_get_error_name(errNo), err_str); + clReleaseProgram(program); + return NULL;