Loading CMakeLists.txt +5 −5 Original line number Diff line number Diff line Loading @@ -108,11 +108,11 @@ register_sanitizer_option (float-divide-by-zero ON) target_compile_options (sanitizer INTERFACE $<$<CONFIG:Sanitized>:-fsanitize-trap=all> $<$<AND:$<CONFIG:Sanitized>,$<PLATFORM_ID:Darwin>>:-fsanitize-trap=all> ) target_link_options (sanitizer INTERFACE $<$<CONFIG:Sanitized>:-fsanitize-trap=all> $<$<AND:$<CONFIG:Sanitized>,$<PLATFORM_ID:Darwin>>:-fsanitize-trap=all> ) #------------------------------------------------------------------------------- Loading graph_driver/xrays.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ int main(int argc, const char * argv[]) { const size_t num_steps = num_times/sub_steps; const size_t num_rays = 100000; std::vector<std::thread> threads(std::max(std::min(static_cast<unsigned int> (jit::context<base, use_safe_math>::max_concurrency), std::vector<std::thread> threads(std::max(std::min(static_cast<unsigned int> (jit::context<base, use_safe_math>::max_concurrency()), static_cast<unsigned int> (num_rays)), static_cast<unsigned int> (1))); Loading graph_framework/cuda_context.hpp +8 −4 Original line number Diff line number Diff line Loading @@ -16,8 +16,12 @@ #include "node.hpp" namespace gpu { // Initialize the cuda driver. static const CUresult init = cuInit(0); //------------------------------------------------------------------------------ /// @brief Initalize cuda. //------------------------------------------------------------------------------ static void init() { cuInit(0); } //------------------------------------------------------------------------------ /// @brief Class representing a cuda gpu context. Loading Loading @@ -74,7 +78,7 @@ namespace gpu { /// @params[in] result Result code of the operation. /// @params[in] name Name of the operation. //------------------------------------------------------------------------------ static void check_error_async(CUresult result, void check_error_async(CUresult result, const std::string &name) { check_error(result, name); #ifndef NDEBUG Loading graph_framework/jit.hpp +20 −2 Original line number Diff line number Diff line Loading @@ -18,12 +18,24 @@ #ifdef USE_METAL #define START_GPU @autoreleasepool { #define END_GPU } #elif defined (USE_CUDA) #define START_GPU jit::init(); #define END_GPU #else #define START_GPU #define END_GPU #endif namespace jit { //------------------------------------------------------------------------------ /// @brief Initalize the gpu\_context. //------------------------------------------------------------------------------ static void init() { #ifdef USE_CUDA gpu::init(); #endif } //------------------------------------------------------------------------------ /// @brief Class for JIT compile of the GPU kernels. //------------------------------------------------------------------------------ Loading Loading @@ -52,8 +64,14 @@ namespace jit { gpu_context_type gpu_context; public: /// The maximum available concurrency. static inline size_t max_concurrency = gpu_context_type::max_concurrency(); //------------------------------------------------------------------------------ /// @brief Get the maximum number of concurrent instances. /// /// @returns The maximum available concurrency. //------------------------------------------------------------------------------ static size_t max_concurrency() { return gpu_context_type::max_concurrency(); } //------------------------------------------------------------------------------ /// @brief Construct a jit context object. Loading Loading
CMakeLists.txt +5 −5 Original line number Diff line number Diff line Loading @@ -108,11 +108,11 @@ register_sanitizer_option (float-divide-by-zero ON) target_compile_options (sanitizer INTERFACE $<$<CONFIG:Sanitized>:-fsanitize-trap=all> $<$<AND:$<CONFIG:Sanitized>,$<PLATFORM_ID:Darwin>>:-fsanitize-trap=all> ) target_link_options (sanitizer INTERFACE $<$<CONFIG:Sanitized>:-fsanitize-trap=all> $<$<AND:$<CONFIG:Sanitized>,$<PLATFORM_ID:Darwin>>:-fsanitize-trap=all> ) #------------------------------------------------------------------------------- Loading
graph_driver/xrays.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ int main(int argc, const char * argv[]) { const size_t num_steps = num_times/sub_steps; const size_t num_rays = 100000; std::vector<std::thread> threads(std::max(std::min(static_cast<unsigned int> (jit::context<base, use_safe_math>::max_concurrency), std::vector<std::thread> threads(std::max(std::min(static_cast<unsigned int> (jit::context<base, use_safe_math>::max_concurrency()), static_cast<unsigned int> (num_rays)), static_cast<unsigned int> (1))); Loading
graph_framework/cuda_context.hpp +8 −4 Original line number Diff line number Diff line Loading @@ -16,8 +16,12 @@ #include "node.hpp" namespace gpu { // Initialize the cuda driver. static const CUresult init = cuInit(0); //------------------------------------------------------------------------------ /// @brief Initalize cuda. //------------------------------------------------------------------------------ static void init() { cuInit(0); } //------------------------------------------------------------------------------ /// @brief Class representing a cuda gpu context. Loading Loading @@ -74,7 +78,7 @@ namespace gpu { /// @params[in] result Result code of the operation. /// @params[in] name Name of the operation. //------------------------------------------------------------------------------ static void check_error_async(CUresult result, void check_error_async(CUresult result, const std::string &name) { check_error(result, name); #ifndef NDEBUG Loading
graph_framework/jit.hpp +20 −2 Original line number Diff line number Diff line Loading @@ -18,12 +18,24 @@ #ifdef USE_METAL #define START_GPU @autoreleasepool { #define END_GPU } #elif defined (USE_CUDA) #define START_GPU jit::init(); #define END_GPU #else #define START_GPU #define END_GPU #endif namespace jit { //------------------------------------------------------------------------------ /// @brief Initalize the gpu\_context. //------------------------------------------------------------------------------ static void init() { #ifdef USE_CUDA gpu::init(); #endif } //------------------------------------------------------------------------------ /// @brief Class for JIT compile of the GPU kernels. //------------------------------------------------------------------------------ Loading Loading @@ -52,8 +64,14 @@ namespace jit { gpu_context_type gpu_context; public: /// The maximum available concurrency. static inline size_t max_concurrency = gpu_context_type::max_concurrency(); //------------------------------------------------------------------------------ /// @brief Get the maximum number of concurrent instances. /// /// @returns The maximum available concurrency. //------------------------------------------------------------------------------ static size_t max_concurrency() { return gpu_context_type::max_concurrency(); } //------------------------------------------------------------------------------ /// @brief Construct a jit context object. Loading