Commit 914ad635 authored by incardon's avatar incardon
Browse files

GPU restored

parent b5b82f5b
Pipeline #2604 passed with stages
in 14 seconds
......@@ -13,10 +13,10 @@ if (CUDA_ON_CPU)
endif()
endif()
add_executable(mem main.cpp memory/HeapMemory.cpp util/cudify/cudify_vars.cpp util/cudify/cudify_unit_test.cu ${CUDA_SOURCES})
add_executable(mem main.cpp memory/HeapMemory.cpp util/cudify/cudify_vars.cpp util/cudify/cudify_unit_test.cu memory/mem_conf.cpp ${CUDA_SOURCES})
add_library(ofpmmemory STATIC memory/HeapMemory.cpp util/cudify/cudify_vars.cpp memory/PtrMemory.cpp ${CUDA_SOURCES})
add_library(ofpmmemory_dl SHARED memory/HeapMemory.cpp util/cudify/cudify_vars.cpp memory/PtrMemory.cpp ${CUDA_SOURCES})
add_library(ofpmmemory STATIC memory/HeapMemory.cpp util/cudify/cudify_vars.cpp memory/PtrMemory.cpp memory/mem_conf.cpp ${CUDA_SOURCES})
add_library(ofpmmemory_dl SHARED memory/HeapMemory.cpp util/cudify/cudify_vars.cpp memory/PtrMemory.cpp memory/mem_conf.cpp ${CUDA_SOURCES})
if ( CMAKE_COMPILER_IS_GNUCC )
target_compile_options(mem PRIVATE "-Wno-deprecated-declarations")
......@@ -30,7 +30,11 @@ if (CUDA_FOUND)
target_compile_options(mem PUBLIC $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe "--display_error_number --diag_suppress=2885 --diag_suppress=2887 --diag_suppress=2888 --diag_suppress=186 --diag_suppress=111" --expt-extended-lambda>)
if (TEST_COVERAGE)
target_compile_options(mem PRIVATE $<$<COMPILE_LANGUAGE:CUDA>: -Xcompiler "-fprofile-arcs -ftest-coverage" >)
endif()
endif()
if (NOT CUDA_ON_CPU)
set_source_files_properties(memory/mem_conf.cpp PROPERTIES LANGUAGE CUDA)
endif()
endif()
......
#include "config.h"
#include "mem_conf.hpp"
size_t openfpm_ofpmmemory_compilation_mask()
{
size_t compiler_mask = 0;
#ifdef CUDA_ON_CPU
compiler_mask |= 0x1;
#endif
#ifdef __NVCC__
compiler_mask |= 0x02;
#endif
#ifdef CUDA_GPU
compiler_mask |= 0x04;
#endif
return compiler_mask;
}
\ No newline at end of file
#ifndef MEM_CONF_HPP_
#define MEM_CONF_HPP_
#include <cstddef>
size_t openfpm_ofpmmemory_compilation_mask();
#endif
\ No newline at end of file
......@@ -8,18 +8,13 @@
#ifndef CUDA_LAUNCH_HPP_
#define CUDA_LAUNCH_HPP_
#include "config.h"
#include "cuda_kernel_error_checker.hpp"
#if defined(CUDA_GPU) && !defined(CUDA_ON_CPU)
#if defined(SE_CLASS1) || defined(CUDA_CHECK_LAUNCH)
template<typename lambda_funct_type, typename ... Args_type>
__global__ void lambda_launcher(lambda_funct_type lbf, Args_type ... args)
{
lbf(args...);
}
#define CUDA_LAUNCH(cuda_call,ite, ...) \
{\
cudaDeviceSynchronize(); \
......
......@@ -9,7 +9,7 @@
#define OPENFPM_DATA_SRC_UTIL_CUDA_UTIL_HPP_
#include "config.h"
#if defined(__NVCC__) && !defined(CUDA_ON_CPU)
#if defined(CUDA_GPU) && !defined(CUDA_ON_CPU)
#include <cuda_runtime.h>
#endif
......
......@@ -295,7 +295,7 @@ namespace mgpu
}
}
static void init_alpaka()
static void init_wrappers()
{
if (__alpa_base__.initialized == true) {return;}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment