-
Notifications
You must be signed in to change notification settings - Fork 94
/
Copy pathkmeans_general.h
26 lines (23 loc) · 1.02 KB
/
kmeans_general.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*!
* Copyright 2017-2018 H2O.ai, Inc.
* License Apache License Version 2.0 (see LICENSE for details)
*/
#pragma once
#include "../../common/logger.h"
#define MAX_NGPUS 16
#define VERBOSE 0
#define CHECK 1
#define DEBUGKMEANS 0
// TODO(pseudotensor): Avoid throw for python exception handling. Need to avoid all exit's and return exit code all the way back.
#define gpuErrchk(ans) { gpu_assert((ans), __FILE__, __LINE__); }
#define safe_cuda(ans) throw_on_cuda_error((ans), __FILE__, __LINE__);
#define safe_cublas(ans) throw_on_cublas_error((ans), __FILE__, __LINE__);
#define CUDACHECK(cmd) do { \
cudaError_t e = cmd; \
if( e != cudaSuccess ) { \
printf("Cuda failure %s:%d '%s'\n", \
__FILE__,__LINE__,cudaGetErrorString(e));\
fflush( stdout ); \
exit(EXIT_FAILURE); \
} \
} while(0)