Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <csignal> 7 : 8 : #ifdef __CUDA_ARCH__ 9 : // When building for Nvidia GPUs we need to disable the use of vector 10 : // intrinsics. 11 : #define BLAZE_USE_VECTORIZATION 0 12 : #endif 13 : 14 : #ifdef SPECTRE_DEBUG 15 : #define BLAZE_THROW(EXCEPTION) \ 16 : struct sigaction handler {}; \ 17 : handler.sa_handler = SIG_IGN; \ 18 : handler.sa_flags = 0; \ 19 : sigemptyset(&handler.sa_mask); \ 20 : sigaction(SIGTRAP, &handler, nullptr); \ 21 : raise(SIGTRAP); \ 22 : throw EXCEPTION 23 : #else // SPECTRE_DEBUG 24 0 : #define BLAZE_THROW(EXCEPTION) 25 : #endif // SPECTRE_DEBUG