Skip to content
Snippets Groups Projects
Commit 7d3c28c5 authored by Eric Wait's avatar Eric Wait
Browse files

Added a sign function to the defines and made the others more robust to order of operations

******Commit to fix another Commit ***********
parent c648c185
No related branches found
No related tags found
No related merge requests found
......@@ -4,11 +4,13 @@
#define MAX_KERNEL_DIM (25)
#define SQR(x) ((x)*(x))
#define MAX(x,y) ((x>y)?(x):(y))
#define MIN(x,y) ((x<y)?(x):(y))
#define MAX(x,y) (((x)>(y))?(x):(y))
#define MIN(x,y) (((x)<(y))?(x):(y))
#define mat_to_c(x) (x-1)
#define c_to_mat(x) (x+1)
#define mat_to_c(x) ((x)-1)
#define c_to_mat(x) ((x)+1)
#define SIGN(x) (((x)>0) ? (1) : (((x)<0.000001 || (x)>-0.00001) ? (0) : (-1)))
//Percent of memory that can be used on the device
const double MAX_MEM_AVAIL = 0.95;
......
......@@ -4,11 +4,13 @@
#define MAX_KERNEL_DIM (25)
#define SQR(x) ((x)*(x))
#define MAX(x,y) ((x>y)?(x):(y))
#define MIN(x,y) ((x<y)?(x):(y))
#define MAX(x,y) (((x)>(y))?(x):(y))
#define MIN(x,y) (((x)<(y))?(x):(y))
#define mat_to_c(x) (x-1)
#define c_to_mat(x) (x+1)
#define mat_to_c(x) ((x)-1)
#define c_to_mat(x) ((x)+1)
#define SIGN(x) (((x)>0) ? (1) : (((x)<0.000001 || (x)>-0.00001) ? (0) : (-1)))
//Percent of memory that can be used on the device
const double MAX_MEM_AVAIL = 0.95;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment