Updated Extras.cpp for new cuda stuff (doesn't do anythin on cpu)

This commit is contained in:
James E McClure 2018-04-19 09:09:37 -04:00
parent 99a22bf7bf
commit 39f5a2daf2

View File

@ -4,6 +4,20 @@
#include <string.h>
#include <mm_malloc.h>
extern "C" int ScaLBL_SetDevice(int rank){
return 0;
}
extern "C" void ScaLBL_AllocateZeroCopy(void** address, size_t size){
//cudaMalloc(address,size);
(*address) = _mm_malloc(size,64);
memset(*address,0,size);
if (*address==NULL){
printf("Memory allocation failed! \n");
}
}
extern "C" void ScaLBL_AllocateDeviceMemory(void** address, size_t size){
//cudaMalloc(address,size);
(*address) = _mm_malloc(size,64);
@ -29,6 +43,11 @@ extern "C" void ScaLBL_CopyToHost(void* dest, const void* source, size_t size){
memcpy(dest, source, size);
}
extern "C" void ScaLBL_CopyToZeroCopy(void* dest, const void* source, size_t size){
// cudaMemcpy(dest,source,size,cudaMemcpyDeviceToHost);
memcpy(dest, source, size);
}
extern "C" void ScaLBL_DeviceBarrier(){
// cudaDeviceSynchronize();
}