@@ -72,7 +72,9 @@ class WorkspaceManager
72
72
//
73
73
74
74
// Default overprov factor for large GPU problems, testing has shown 1.25 is optimal
75
- static constexpr double GPU_DEFAULT_OVERPROVISION_FACTOR = 1.25 ;
75
+ // Some linkers were having trouble with the code below, so use a function
76
+ // static inline constexpr double GPU_DEFAULT_OVERPROVISION_FACTOR = 1.25;
77
+ static constexpr double GPU_DEFAULT_OVERPROVISION_FACTOR () { return 1.25 ; }
76
78
77
79
//
78
80
// ------- public API ---------
@@ -87,7 +89,7 @@ class WorkspaceManager
87
89
// policy: The team policy for Kokkos kernels using this WorkspaceManager
88
90
// overprov_factor: How many workspace slots to overprovision (only applies to GPU for large problems)
89
91
WorkspaceManager (int size, int max_used, TeamPolicy policy,
90
- const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR);
92
+ const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR() );
91
93
92
94
// Constructor, call from host
93
95
// Same as above, but here the user initializes the data.
@@ -97,14 +99,14 @@ class WorkspaceManager
97
99
// data is available, for which the get_total_slots_to_be_used()
98
100
// function can be helpful.
99
101
WorkspaceManager (T* data, int size, int max_used, TeamPolicy policy,
100
- const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR);
102
+ const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR() );
101
103
102
104
// Helper functions which return the number of bytes that will be reserved for a given
103
105
// set of constructor inputs. Note, this does not actually create an instance of the WSM,
104
106
// but is useful for when memory needs to be reserved in a different scope than the
105
107
// WSM is created.
106
108
static int get_total_bytes_needed (int size, int max_used, TeamPolicy policy,
107
- const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR);
109
+ const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR() );
108
110
109
111
// call from host.
110
112
//
@@ -116,14 +118,14 @@ class WorkspaceManager
116
118
//
117
119
// Setup routine for the WSM if the user used the empty constructor
118
120
void setup (int size, int max_used, TeamPolicy policy,
119
- const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR);
121
+ const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR() );
120
122
121
123
// call from host.
122
124
//
123
125
// Setup routine for the WSM if the user used the empty constructor.
124
126
// Same as above, but here the user initializes the data.
125
127
void setup (T* data, int size, int max_used, TeamPolicy policy,
126
- const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR);
128
+ const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR() );
127
129
128
130
// call from host.
129
131
//
@@ -377,9 +379,6 @@ class WorkspaceManager
377
379
void operator () (const MemberType& team) const ;
378
380
}; // class WorkspaceManager
379
381
380
- template <typename T, typename D>
381
- constexpr double WorkspaceManager<T, D>::GPU_DEFAULT_OVERPROVISION_FACTOR;
382
-
383
382
} // namespace ekat
384
383
385
384
#include " ekat_workspace_impl.hpp"
0 commit comments