From 27d14f4fc0d66e495df23dc5e465ca865f78c406 Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Thu, 13 Oct 2016 12:35:16 +0100 Subject: [PATCH] hostside_openclfuncs_assure_initialized was being inlined, not sure why... --- Makefile | 6 +++--- src/hostside_opencl_funcs.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 882979e5..85c9b462 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ easycl: cd build && make -j 4 build/hostside_opencl_funcs.o: src/hostside_opencl_funcs.cpp - $(CLANG) -c -o $@ -std=c++11 -O3 -I$(COCL_HOME)/src/EasyCL $< + $(CLANG) -c -o $@ -std=c++11 -O2 -I$(COCL_HOME)/src/EasyCL $< build/libcocl.a: build/hostside_opencl_funcs.o ar rcs $@ $^ @@ -73,8 +73,8 @@ build/test-%.o: test/%.cu $(COCL_HOME)/bin/cocl -I$(EIGEN_HOME) -I$(EIGEN_HOME)/test -I$(COCL_HOME)/test/eigen -c -o $@ $< # executables -build/cuda_sample: build/test-cuda_sample.o build/hostside_opencl_funcs.o test/generated/cuda_sample-device.cl - g++ -o $@ $< build/hostside_opencl_funcs.o -lOpenCL -Lbuild -lEasyCL +build/cuda_sample: build/test-cuda_sample.o build/libcocl.a test/generated/cuda_sample-device.cl + g++ -o $@ $< -lcocl -lOpenCL -Lbuild -lEasyCL build/eigen-%: build/eigen-%.o build/libcocl.a g++ -o $@ $< -lcocl -lOpenCL -Lbuild -lEasyCL diff --git a/src/hostside_opencl_funcs.cpp b/src/hostside_opencl_funcs.cpp index 6398f4ea..30c51ccc 100644 --- a/src/hostside_opencl_funcs.cpp +++ b/src/hostside_opencl_funcs.cpp @@ -39,17 +39,17 @@ static map idxByAddr; static bool initialized = false; extern "C" { - void hostside_opencl_funcs_assure_initialized(); + void hostside_opencl_funcs_assure_initialized(void); } -static void hostside_opencl_funcs_init() { +void hostside_opencl_funcs_init() { cout << "initialize cl context" << endl; cl.reset(EasyCL::createForFirstGpuOtherwiseCpu()); ctx = cl->context; queue = cl->queue; } -void hostside_opencl_funcs_assure_initialized() { +void hostside_opencl_funcs_assure_initialized(void) { // yes this is not threadsafe. or anything safe really... if(!initialized) { hostside_opencl_funcs_init();