Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 11f5622

Browse files
authored
Support for vectorplay on GPU (#84)
1 parent c7d9ee3 commit 11f5622

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

coreneuron/nrniv/vrecord.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ void VecPlayContinuous::deliver(double tt, NetCvode* ns) {
116116
NrnThread* nt = nrn_threads + ith_;
117117
// printf("deliver %g\n", tt);
118118
last_index_ = ubound_index_;
119+
#pragma acc update device(last_index_) if (nt->compute_gpu)
119120
if (discon_indices_) {
120121
if (discon_index_ < discon_indices_->size()) {
121122
ubound_index_ = (int)(*discon_indices_)[discon_index_++];
@@ -130,11 +131,16 @@ void VecPlayContinuous::deliver(double tt, NetCvode* ns) {
130131
e_->send((*t_)[ubound_index_], ns, nt);
131132
}
132133
}
134+
#pragma acc update device(ubound_index_) if (nt->compute_gpu)
133135
continuous(tt);
134136
}
135137

136138
void VecPlayContinuous::continuous(double tt) {
137-
*pd_ = interpolate(tt);
139+
NrnThread* nt = nrn_threads + ith_;
140+
#pragma acc kernels present(this) if(nt->compute_gpu)
141+
{
142+
*pd_ = interpolate(tt);
143+
}
138144
}
139145

140146
double VecPlayContinuous::interpolate(double tt) {
@@ -176,5 +182,5 @@ void VecPlayContinuous::search(double tt) {
176182

177183
void VecPlayContinuous::pr() {
178184
printf("VecPlayContinuous ");
179-
// printf("%s.x[%d]\n", hoc_object_name(y_->obj_), last_index_);
185+
// printf("%s.x[%d]\n", hoc_object_name(y_->obj_), last_index_);
180186
}

0 commit comments

Comments
 (0)