13 lines
530 B
Text
13 lines
530 B
Text
#include <iostream>
|
|
#include "cuda.h"
|
|
|
|
int main() {
|
|
size_t free_t, total_t;
|
|
cudaError_t err;
|
|
err = cudaMemGetInfo(&free_t, &total_t);
|
|
if (err != cudaSuccess) { printf("cudaMalloc d_steps_arr error: %s\n", cudaGetErrorString(err)); return 1; }
|
|
std::cout << "Free mem: " << free_t / (1024 * 1024) << " MB Total mem: " << total_t / (1024 * 1024) << " MB" << std::endl;
|
|
std::cout << "Free mem: " << free_t / (1024 * 1024 * 1024) << " GB Total mem: " << total_t / (1024 * 1024 * 1024) << " GB" << std::endl;
|
|
return 0;
|
|
}
|
|
|