| 39 | /*************** NPZ related operations *****************/ |
| 40 | template<typename T> |
| 41 | void printDevPtr(const T* d_cache, int len, char* name, bool print) |
| 42 | { |
| 43 | T* res = (T*)malloc(sizeof(T) * len); |
| 44 | cudaMemcpy(res, d_cache, sizeof(T) * len, cudaMemcpyDeviceToHost); |
| 45 | |
| 46 | printf("%s ", name); |
| 47 | int j = 0; |
| 48 | for (int i = 0; i < len; i++) { |
| 49 | if (res[i]) { |
| 50 | printf("%f ", (float)res[i]); |
| 51 | if (j % 20 == 19) { |
| 52 | printf("\n"); |
| 53 | } |
| 54 | } |
| 55 | j = j + 1; |
| 56 | } |
| 57 | free(res); |
| 58 | printf("\n"); |
| 59 | } |
| 60 | |
| 61 | template<typename T> |
| 62 | float castToFloat(T input) |
nothing calls this directly
no outgoing calls
no test coverage detected