Skip to content

Commit 35f0822

Browse files
committed
Fix NVHPC warnings in native GPU build sources
Remove unused sync_voltage_and_rhs_to_device helper, mark solve_interleaved2_loop_body as routine gang so inner loop vector directives are valid under the outer gang parallel region, and use the nodiscard ensure_on_device return value in the device_state test.
1 parent 352bb6b commit 35f0822

3 files changed

Lines changed: 3 additions & 18 deletions

File tree

src/coreneuron/permute/cellorder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ static void bksub_interleaved(NrnThread* nt,
619619
}
620620
}
621621

622-
nrn_pragma_acc(routine vector)
622+
nrn_pragma_acc(routine gang)
623623
static void solve_interleaved2_loop_body(NrnThread* nt,
624624
double* vec_a,
625625
double* vec_b,

src/neuron/gpu/sync.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,6 @@ void sync_matrix_arrays_to_host(NrnThread& nt) {
8484
#endif
8585
}
8686

87-
void sync_voltage_and_rhs_to_device(NrnThread& nt) {
88-
#if defined(NRN_ENABLE_GPU)
89-
if (!nt.compute_gpu || nt.end <= 0) {
90-
return;
91-
}
92-
auto* const vec_v = nt.node_voltage_storage();
93-
auto* const vec_rhs = nt.node_rhs_storage();
94-
nrn_pragma_acc(update device(vec_v [0:nt.end], vec_rhs [0:nt.end]) if (nt.compute_gpu)
95-
async(nt.stream_id))
96-
nrn_pragma_omp(target update to(vec_v [0:nt.end], vec_rhs [0:nt.end]) if (nt.compute_gpu))
97-
nrn_pragma_acc(wait(nt.stream_id))
98-
#else
99-
(void) nt;
100-
#endif
101-
}
102-
10387
} // namespace
10488

10589
void sync_before_vecplay(NrnThread& nt) {

test/unit_tests/gpu/device_state.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ TEST_CASE("invalidate_device_state clears GPU mirrors", "[gpu][device_state]") {
122122
neuron::container::Node::storage nodes{};
123123
auto node_token = nodes.issue_frozen_token();
124124
neuron::model_sorted_token sorted{cache, std::move(node_token)};
125-
ensure_on_device(sorted);
125+
device_token const& token = ensure_on_device(sorted);
126+
REQUIRE(token.is_on_device());
126127
REQUIRE(detail::is_on_device_for_testing());
127128
invalidate_device_state();
128129
REQUIRE_FALSE(detail::is_on_device_for_testing());

0 commit comments

Comments
 (0)