From becdc3a1adda892eef51833e41476ab940447290 Mon Sep 17 00:00:00 2001 From: Kevin Petit Date: Wed, 20 Feb 2019 16:10:40 +0000 Subject: [PATCH] Fix build of printf test Also build as C++11 (required for unique_ptr) Signed-off-by: Kevin Petit --- test_conformance/printf/CMakeLists.txt | 2 ++ test_conformance/printf/test_printf.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test_conformance/printf/CMakeLists.txt b/test_conformance/printf/CMakeLists.txt index 914ffb58..a5c23bcb 100644 --- a/test_conformance/printf/CMakeLists.txt +++ b/test_conformance/printf/CMakeLists.txt @@ -1,5 +1,7 @@ set(MODULE_NAME PRINTF) +set(CMAKE_CXX_STANDARD 11) + set(${MODULE_NAME}_SOURCES test_printf.c util_printf.c diff --git a/test_conformance/printf/test_printf.c b/test_conformance/printf/test_printf.c index efaecfe2..75d3fde3 100644 --- a/test_conformance/printf/test_printf.c +++ b/test_conformance/printf/test_printf.c @@ -410,6 +410,7 @@ static int doTest(cl_command_queue queue, cl_context context, const unsigned int char _analysisBuffer[ANALYSIS_BUFFER_SIZE]; cl_uint out32 = 0; cl_ulong out64 = 0; + int fd = -1; // Define an index space (global work size) of threads for execution. size_t globalWorkSize[1]; @@ -456,7 +457,7 @@ static int doTest(cl_command_queue queue, cl_context context, const unsigned int } } - int fd = acquireOutputStream(); + fd = acquireOutputStream(); globalWorkSize[0] = 1; cl_event ndrEvt; err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, globalWorkSize, NULL, 0, NULL,&ndrEvt);