Skip to content

Commit 07c3a3a

Browse files
committed
fixup chrono
1 parent 3289637 commit 07c3a3a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

brian2cuda/templates/synapses_create_array.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ size_t used_device_memory_start = used_device_memory;
3737
CUDA_CHECK_MEMORY();
3838
const double to_MB = 1.0 / (1024.0 * 1024.0);
3939
double tot_memory_MB = (used_device_memory - used_device_memory_start) * to_MB;
40-
double time_passed = std::chrono::duration_cast<std::chrono::nanoseconds>((std::chrono::high_resolution_clock::now() - start_timer);
40+
double time_passed = std::chrono::duration<double>(std::chrono::high_resolution_clock::now() - start_timer).count();
4141
std::cout << "INFO: {{owner.name}} creation took " << time_passed << "s";
4242
if (tot_memory_MB > 0)
4343
std::cout << " and used " << tot_memory_MB << "MB of device memory.";

brian2cuda/templates/synapses_create_generator.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ size_t used_device_memory_start = used_device_memory;
154154
CUDA_CHECK_MEMORY();
155155
const double to_MB = 1.0 / (1024.0 * 1024.0);
156156
double tot_memory_MB = (used_device_memory - used_device_memory_start) * to_MB;
157-
double time_passed = std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now() - start_timer);
157+
double time_passed = std::chrono::duration<double>(std::chrono::high_resolution_clock::now() - start_timer).count();
158158
std::cout << "INFO: {{owner.name}} creation took " << time_passed << "s";
159159
if (tot_memory_MB > 0)
160160
std::cout << " and used " << tot_memory_MB << "MB of memory.";

brian2cuda/templates/synapses_push_spikes.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ __global__ void _before_run_kernel_{{codeobj_name}}(
977977
}
978978

979979
CUDA_CHECK_MEMORY();
980-
double time_passed = std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now() - start_timer);
980+
double time_passed = std::chrono::duration<double>(std::chrono::high_resolution_clock::now() - start_timer).count();
981981
std::cout << "INFO: {{owner.name}} initialisation took " << time_passed << "s";
982982
if (used_device_memory_after_dealloc < used_device_memory_start){
983983
size_t freed_bytes = used_device_memory_start - used_device_memory_after_dealloc;

0 commit comments

Comments
 (0)