[v0.11] Add peak performance with tensor cores to the output

This commit is contained in:
Dr-Noob
2021-11-23 18:49:34 +01:00
parent 8bf0276aae
commit 32b2c59b50
5 changed files with 34 additions and 8 deletions

View File

@@ -103,10 +103,16 @@ struct memory* get_memory_info(struct gpu_info* gpu, cudaDeviceProp prop) {
return mem;
}
// Compute peak performance when using CUDA cores
int64_t get_peak_performance(struct gpu_info* gpu) {
return gpu->freq * 1000000 * gpu->topo->cuda_cores * 2;
}
// Compute peak performance when using tensor cores
int64_t get_peak_performance_t(struct gpu_info* gpu) {
return gpu->freq * 1000000 * 4 * 4 * 8 * gpu->topo->tensor_cores;
}
struct gpu_info* get_gpu_info(int gpu_idx) {
struct gpu_info* gpu = (struct gpu_info*) emalloc(sizeof(struct gpu_info));
gpu->pci = NULL;
@@ -156,6 +162,7 @@ struct gpu_info* get_gpu_info(int gpu_idx) {
gpu->mem = get_memory_info(gpu, deviceProp);
gpu->topo = get_topology_info(deviceProp);
gpu->peak_performance = get_peak_performance(gpu);
gpu->peak_performance_t = get_peak_performance_t(gpu);
return gpu;
}