Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102991147
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
Wed, Feb 26, 05:34
Size
852 B
Mime Type
text/x-c
Expires
Fri, Feb 28, 05:34 (1 d, 19 h)
Engine
blob
Format
Raw Data
Handle
24477282
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.
*/
void cudasafe( cudaError_t error, std::string message)
{
if(error!=cudaSuccess) {
fprintf(stderr,"ERROR: %s : %s \n",message.c_str(),cudaGetErrorString(error));
exit(-1);
}
}
Event Timeline
Log In to Comment