From 7aec83b2fcc9cd3d1552a9340251434801f9626d Mon Sep 17 00:00:00 2001 From: ergawy Date: Thu, 21 Nov 2024 05:39:36 -0600 Subject: [PATCH] Move dynamic stack allocations outside `do concurrent` Dyanmic stack alloctaions are those allocs where memory is allocated on the stack (i.e. inside a function or proceure) with a size not known at compile time. Even though this is legal both at compile and run-times for the CPU on the GPU this is not supported. Therefore, this PR removes an instance of such allocations (this is the only instance I came across so far while compiling for the GPU). --- src/fiats/neural_network_s.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fiats/neural_network_s.F90 b/src/fiats/neural_network_s.F90 index 6f3334c80..1989aabdd 100644 --- a/src/fiats/neural_network_s.F90 +++ b/src/fiats/neural_network_s.F90 @@ -926,6 +926,9 @@ block real reduce_dcdb(size(dcdb,1),size(dcdb,2),mini_batch_size) real reduce_dcdw(size(dcdw,1),size(dcdw,2),size(dcdw,3),mini_batch_size) + real a(maxval(self%nodes_), input_layer:output_layer) ! Activations + real z(size(b,1),size(b,2)), delta(size(b,1),size(b,2)) + reduce_dcdb = 0. reduce_dcdw = 0. @@ -934,9 +937,6 @@ iteration: & block - - real a(maxval(self%nodes_), input_layer:output_layer) ! Activations - real z(size(b,1),size(b,2)), delta(size(b,1),size(b,2)) #endif a(1:self%num_inputs(), input_layer) = inputs(pair)%values()