Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93793927
module_readParameters_GPU.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
Sun, Dec 1, 13:40
Size
2 KB
Mime Type
text/x-c
Expires
Tue, Dec 3, 13:40 (2 d)
Engine
blob
Format
Raw Data
Handle
22703557
Attached To
R1448 Lenstool-HPC
module_readParameters_GPU.cu
View Options
#include "grid_gradient_GPU.cuh"
#include "gradient.hpp"
#include "gradient_GPU.cuh"
#include "gradient.hpp"
#include "module_readParameters.hpp"
extern void cudasafe( cudaError_t error, const char* message);
void checkCudaError(cudaError_t error)
{
if(error != cudaSuccess) printf("Error: %s\n", cudaGetErrorString(error));
}
//
//
//
void module_readParameters_PotentialSOA_noalloc_GPU(std::string infile, Potential_SOA *lens_SOA, int nhalos, int n_tot_halos, cosmo_param cosmology)
{
module_readParameters_PotentialSOA_noalloc(infile, lens_SOA, nhalos, n_tot_halos, cosmology);
#if defined(__WITH_UM)
// let's prefetch the data in the GPU memory
#warning "Prefetching data on GPU"
checkCudaError(cudaMemPrefetchAsync(lens_SOA , sizeof(Potential_SOA), 0));
checkCudaError(cudaMemPrefetchAsync(lens_SOA->position_x , nhalos*sizeof(type_t), 0));
checkCudaError(cudaMemPrefetchAsync(lens_SOA->position_y , nhalos*sizeof(type_t), 0));
checkCudaError(cudaMemPrefetchAsync(lens_SOA->anglecos , nhalos*sizeof(type_t), 0));
checkCudaError(cudaMemPrefetchAsync(lens_SOA->anglesin , nhalos*sizeof(type_t), 0));
checkCudaError(cudaMemPrefetchAsync(lens_SOA->ellipticity_potential , nhalos*sizeof(type_t), 0));
checkCudaError(cudaMemPrefetchAsync(lens_SOA->rcore , nhalos*sizeof(type_t), 0));
checkCudaError(cudaMemPrefetchAsync(lens_SOA->rcut , nhalos*sizeof(type_t), 0));
checkCudaError(cudaMemPrefetchAsync(lens_SOA->b0 , nhalos*sizeof(type_t), 0));
checkCudaError(cudaMemPrefetchAsync(lens_SOA->ellipticity_angle , nhalos*sizeof(type_t), 0));
checkCudaError(cudaMemPrefetchAsync(lens_SOA->ellipticity , nhalos*sizeof(type_t), 0));
checkCudaError(cudaMemPrefetchAsync(lens_SOA->vdisp , nhalos*sizeof(type_t), 0));
checkCudaError(cudaMemPrefetchAsync(lens_SOA->z , nhalos*sizeof(type_t), 0));
checkCudaError(cudaMemPrefetchAsync(lens_SOA->N_types , nhalos*sizeof(int), 0));
checkCudaError(cudaMemPrefetchAsync(lens_SOA->type , 100*sizeof(int), 0));
#endif
}
Event Timeline
Log In to Comment