1 #ifndef CUFFTADVISOR_UTILS_H_ 2 #define CUFFTADVISOR_UTILS_H_ 9 #define CLOCKS_PER_MS (CLOCKS_PER_SEC / 1000) 13 static inline std::string numToString(T num) {
20 static inline float toMB(
size_t bytes) {
return bytes / 1048576.f; }
23 static inline void deleteEach(std::vector<T *> &v) {
24 typename std::vector<T *>::iterator it;
25 for (it = v.begin(); it != v.end(); ++it) {
44 static inline const char *toString(
Tristate t) {
45 if (t ==
FALSE)
return "false";
46 if (t ==
TRUE)
return "true";
65 return "Tristate undefined";
69 static inline bool safeEquals(
const char *l,
const char *r) {
70 if ((NULL == l) || (NULL == r))
73 return (0 == std::strcmp(l, r));
78 #endif // CUFFTADVISOR_UTILS_H_