File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,8 +39,9 @@ namespace af
3939
4040 features::~features ()
4141 {
42- if (AF_SUCCESS != af_release_features (feat)) {
43- fprintf (stderr, " Error: Couldn't release af::features: %p\n " , this );
42+ // THOU SHALL NOT THROW IN DESTRUCTORS
43+ if (feat) {
44+ af_release_features (feat);
4445 }
4546 }
4647
Original file line number Diff line number Diff line change @@ -44,7 +44,10 @@ Window::Window(const af_window window)
4444
4545Window::~Window ()
4646{
47- AF_THROW (af_destroy_window (wnd));
47+ // THOU SHALL NOT THROW IN DESTRUCTORS
48+ if (wnd) {
49+ af_destroy_window (wnd);
50+ }
4851}
4952
5053void Window::setPos (const unsigned x, const unsigned y)
Original file line number Diff line number Diff line change @@ -64,7 +64,14 @@ IF(UNIX)
6464 # GCC 5.3 and above give errors for mempcy from <string.h>
6565 # This is a (temporary) fix for that
6666 IF ("${CMAKE_C_COMPILER_ID} " STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.3.0" )
67- ADD_DEFINITIONS (-D_FORCE_INLINES )
67+ ADD_DEFINITIONS (-D_FORCE_INLINES )
68+ ENDIF ()
69+
70+ # GCC 6.0 and above default to g++14, enabling c++11 features by default
71+ # Enabling c++11 with nvcc 7.5 + gcc 6.x doesn't seem to work
72+ # Only solution for now is to force use c++03 for gcc 6.x
73+ IF ("${CMAKE_C_COMPILER_ID} " STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "6.0.0" )
74+ SET (CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xcompiler -std=c++98" )
6875 ENDIF ()
6976
7077 # Forcing STRICT ANSI should resolve a bunch of issues that NVIDIA seems to face with GCC compilers.
Original file line number Diff line number Diff line change @@ -231,9 +231,10 @@ namespace opencl
231231 {
232232 auto func = [=] (void * ptr) {
233233 try {
234- if (ptr != nullptr )
234+ if (ptr != nullptr ) {
235235 getQueue ().enqueueUnmapMemObject (*data, ptr);
236236 ptr = nullptr ;
237+ }
237238 } catch (cl::Error err) {
238239 CL_TO_AF_ERROR (err);
239240 }
Original file line number Diff line number Diff line change @@ -233,7 +233,12 @@ CL_KERNEL_TO_H(
233233
234234# OS Definitions
235235IF (UNIX )
236- SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread -Wno-comment" )
236+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread -Wno-comment" )
237+ # GCC 6.0 and above enable -Wignored-attributes by default causing a lot of warnings
238+ # Disable the trigger for gcc >= 6.0.0
239+ IF ("${CMAKE_C_COMPILER_ID} " STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "6.0.0" )
240+ ADD_DEFINITIONS (-Wno-ignored-attributes )
241+ ENDIF ()
237242ENDIF ()
238243
239244INCLUDE ("${CMAKE_CURRENT_SOURCE_DIR} /kernel/sort_by_key/CMakeLists.txt" )
Original file line number Diff line number Diff line change @@ -52,7 +52,8 @@ class clFFTPlanner
5252 #ifndef OS_WIN
5353 static bool flag = true ;
5454 if (flag) {
55- CLFFT_CHECK (clfftTeardown ());
55+ // THOU SHALL NOT THROW IN DESTRUCTORS
56+ clfftTeardown ();
5657 flag = false ;
5758 }
5859 #endif
You can’t perform that action at this time.
0 commit comments