Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92330043
cudafunctions_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
Tue, Nov 19, 11:06
Size
1 KB
Mime Type
text/x-c
Expires
Thu, Nov 21, 11:06 (2 d)
Engine
blob
Format
Raw Data
Handle
22393414
Attached To
R1448 Lenstool-HPC
cudafunctions_cu
View Options
/**
* @file cudafunctions.cpp
* @Author Christoph Schaefer, EPFL (christophernstrerne.schaefer@epfl.ch)
* @date July 2015
* @version 0,1
* @brief Functions for safe calling of cuda function and timing functions
*
*/
/// Include
///==========================================================================================================
#include<stdio.h>
#include<string>
#include<strings.h>
#include<stdlib.h>
#include<iostream>
#include<fstream>
#include<math.h>
#include<time.h>
#include"cudafunctions.cuh"
#include<cuda_runtime.h>
#include<typeinfo>
/** @brief Safe Cuda call function. Checks for error, prints and then stops the execution.
*/
#define cudasafe CUDA_SAFE_CALL
#define CUDA_SAFE_CALL(call, mess) \
do { \
cudaError_t err = call; \
if (cudaSuccess != err) { \
fprintf (stderr, "'%s' Cuda error in file '%s' in line %i : %s.", \
__FILE__, __LINE__, mess, cudaGetErrorString(err) ); \
exit(EXIT_FAILURE); \
} \
} while (0)
Event Timeline
Log In to Comment