Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91659801
cuda_memory.cu
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Nov 13, 04:57
Size
354 B
Mime Type
text/x-c
Expires
Fri, Nov 15, 04:57 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
22302615
Attached To
R11986 miniapp_gbs_gradients
cuda_memory.cu
View Options
#include <stdio.h>
#include <cuda.h>
#include <cuda_runtime.h>
extern "C" void *allocate_cuda_memory(int *n){
double *a;
int N=*n;
//a = (float *)malloc(*n*sizeof(float));
cudaMallocManaged( (void **)&a, sizeof(double) * N );
cudaDeviceSynchronize();
return (void *) a;
}
extern "C" void deallocate_cuda(double *a){
cudaFree(a);
}
Event Timeline
Log In to Comment