@@ -72,7 +72,9 @@ class WorkspaceManager
7272 //
7373
7474 // 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 ; }
7678
7779 //
7880 // ------- public API ---------
@@ -87,7 +89,7 @@ class WorkspaceManager
8789 // policy: The team policy for Kokkos kernels using this WorkspaceManager
8890 // overprov_factor: How many workspace slots to overprovision (only applies to GPU for large problems)
8991 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 () );
9193
9294 // Constructor, call from host
9395 // Same as above, but here the user initializes the data.
@@ -97,14 +99,14 @@ class WorkspaceManager
9799 // data is available, for which the get_total_slots_to_be_used()
98100 // function can be helpful.
99101 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 () );
101103
102104 // Helper functions which return the number of bytes that will be reserved for a given
103105 // set of constructor inputs. Note, this does not actually create an instance of the WSM,
104106 // but is useful for when memory needs to be reserved in a different scope than the
105107 // WSM is created.
106108 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 () );
108110
109111 // call from host.
110112 //
@@ -116,14 +118,14 @@ class WorkspaceManager
116118 //
117119 // Setup routine for the WSM if the user used the empty constructor
118120 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 () );
120122
121123 // call from host.
122124 //
123125 // Setup routine for the WSM if the user used the empty constructor.
124126 // Same as above, but here the user initializes the data.
125127 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 () );
127129
128130 // call from host.
129131 //
@@ -377,9 +379,6 @@ class WorkspaceManager
377379 void operator () (const MemberType& team) const ;
378380}; // class WorkspaceManager
379381
380- template <typename T, typename D>
381- constexpr double WorkspaceManager<T, D>::GPU_DEFAULT_OVERPROVISION_FACTOR ;
382-
383382} // namespace ekat
384383
385384#include " ekat_workspace_impl.hpp"
0 commit comments