Move common exceptions to common.h
This commit is contained in:
parent
201bc4638f
commit
dea95fe68e
17
common.h
17
common.h
@ -14,6 +14,23 @@ extern bool useFloat;
|
|||||||
|
|
||||||
extern int deviceIndex;
|
extern int deviceIndex;
|
||||||
|
|
||||||
|
// Exceptions
|
||||||
|
struct invaliddevice : public std::exception
|
||||||
|
{
|
||||||
|
virtual const char * what () const throw ()
|
||||||
|
{
|
||||||
|
return "Chosen device index is invalid";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct badntimes : public std::exception
|
||||||
|
{
|
||||||
|
virtual const char * what () const throw ()
|
||||||
|
{
|
||||||
|
return "Chosen number of times is invalid, must be >= 2";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template < typename T >
|
template < typename T >
|
||||||
void check_solution(void* a_in, void* b_in, void* c_in)
|
void check_solution(void* a_in, void* b_in, void* c_in)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -11,22 +11,6 @@
|
|||||||
|
|
||||||
std::string getDeviceName(int device);
|
std::string getDeviceName(int device);
|
||||||
|
|
||||||
struct invaliddevice : public std::exception
|
|
||||||
{
|
|
||||||
virtual const char * what () const throw ()
|
|
||||||
{
|
|
||||||
return "Chosen device index is invalid";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct badntimes : public std::exception
|
|
||||||
{
|
|
||||||
virtual const char * what () const throw ()
|
|
||||||
{
|
|
||||||
return "Chosen number of times is invalid, must be >= 2";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Code to check CUDA errors
|
// Code to check CUDA errors
|
||||||
void check_cuda_error(void)
|
void check_cuda_error(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -21,22 +21,6 @@ struct badfile : public std::exception
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct invaliddevice : public std::exception
|
|
||||||
{
|
|
||||||
virtual const char * what () const throw ()
|
|
||||||
{
|
|
||||||
return "Chosen device index is invalid";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct badntimes : public std::exception
|
|
||||||
{
|
|
||||||
virtual const char * what () const throw ()
|
|
||||||
{
|
|
||||||
return "Chosen number of times is invalid, must be >= 2";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Print error and exit
|
// Print error and exit
|
||||||
void die(std::string msg, cl::Error& e)
|
void die(std::string msg, cl::Error& e)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user