This repository was archived by the owner on Mar 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathdimplic.cpp
More file actions
54 lines (47 loc) · 1.84 KB
/
dimplic.cpp
File metadata and controls
54 lines (47 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
# =============================================================================
# Copyright (c) 2016 - 2021 Blue Brain Project/EPFL
#
# See top-level LICENSE file for details.
# =============================================================================
*/
/** When we use solve methods like euler, newton or kinetic schemes,
* the state/current updates function need to call solver methods
* defined in coreneuron. This is typically done via function pointers.
* But for GPU implementation using OpenACC, we can't pass function
* pointers.The temporary "workaround" for this was to generate
* switch case to select the proper callback function. This is implemented
* using python script that look into translated file and generate
* _kinderiv.h which has cases for steer functions defined below.
* This allows OpenACC to select gpu implementations at compile
* time.
* \todo: eulerfun/difun are legacy macros and can be replaced with
* actual steer function for euler/derivimplicit methods.
*/
#include "coreneuron/mechanism/mech/cfile/scoplib.h"
#include "coreneuron/mechanism/mech/mod2c_core_thread.hpp"
#include "_kinderiv.h"
namespace coreneuron {
nrn_pragma_omp(declare target)
int derivimplicit_thread(int n, int* slist, int* dlist, DIFUN fun, _threadargsproto_) {
difun(fun);
return 0;
}
int nrn_derivimplicit_steer(int fun, _threadargsproto_) {
switch (fun) { _NRN_DERIVIMPLICIT_CASES }
return 0;
}
int nrn_euler_steer(int fun, _threadargsproto_) {
switch (fun) { _NRN_EULER_CASES }
return 0;
}
int nrn_newton_steer(int fun, _threadargsproto_) {
switch (fun) { _NRN_DERIVIMPLICIT_NEWTON_CASES }
return 0;
}
int nrn_kinetic_steer(int fun, SparseObj* so, double* rhs, _threadargsproto_) {
switch (fun) { _NRN_KINETIC_CASES }
return 0;
}
nrn_pragma_omp(end declare target)
} // namespace coreneuron