22 #if !defined( BOLT_AMP_CONTROL_H )
23 #define BOLT_AMP_CONTROL_H
91 enum e_AutoTuneMode{NoAutoTune=0x0,
93 AutoTuneWorkShape=0x2,
96 static const unsigned None=0;
97 static const unsigned Compile = 0x1;
98 static const unsigned ShowCode = 0x2;
99 static const unsigned SaveCompilerTemps = 0x4;
100 static const unsigned DebugKernelRun = 0x8;
101 static const unsigned AutoTune = 0x10;
115 Concurrency::accelerator accel=
getDefault().getAccelerator(),
116 e_UseHostMode useHost=
getDefault().getUseHost(),
119 m_accelerator(accel),
122 m_defaultRunMode(
getDefault().m_defaultRunMode),
125 m_wgPerComputeUnit(
getDefault().m_wgPerComputeUnit),
130 control(
const control& ref) :
131 m_accelerator(ref.m_accelerator),
132 m_useHost(ref.m_useHost),
133 m_forceRunMode(ref.m_forceRunMode),
134 m_defaultRunMode(ref.m_defaultRunMode),
135 m_debug(ref.m_debug),
136 m_autoTune(ref.m_autoTune),
137 m_wgPerComputeUnit(ref.m_wgPerComputeUnit),
138 m_waitMode(ref.m_waitMode),
139 m_unroll(ref.m_unroll)
146 void setAccelerator(::Concurrency::accelerator accel) { m_accelerator = accel; };
151 void setUseHost(e_UseHostMode useHost) { m_useHost = useHost; };
184 Concurrency::accelerator& getAccelerator( ) {
return m_accelerator; };
185 const Concurrency::accelerator& getAccelerator( )
const {
return m_accelerator; };
187 e_UseHostMode getUseHost()
const {
return m_useHost; };
188 e_RunMode getForceRunMode()
const {
return m_forceRunMode; };
189 e_RunMode getDefaultPathToRun()
const {
return m_defaultRunMode; };
190 unsigned getDebug()
const {
return m_debug;};
191 int const getWGPerComputeUnit()
const {
return m_wgPerComputeUnit; };
192 e_WaitMode getWaitMode()
const {
return m_waitMode; };
193 int getUnroll()
const {
return m_unroll; };
213 static control _defaultControl(
true );
214 return _defaultControl;
226 m_accelerator( Concurrency::accelerator::default_accelerator ),
228 m_forceRunMode(Automatic),
229 m_debug(debug::None),
230 m_autoTune(AutoTuneAll),
231 m_wgPerComputeUnit(8),
232 m_waitMode(BusyWait),
236 if(m_accelerator.default_accelerator == NULL)
239 m_forceRunMode = MultiCoreCpu;
240 m_defaultRunMode = MultiCoreCpu;
242 m_forceRunMode = SerialCpu;
243 m_defaultRunMode = SerialCpu;
248 m_forceRunMode = Gpu;
249 m_defaultRunMode = Gpu;
256 ::Concurrency::accelerator m_accelerator;
257 e_UseHostMode m_useHost;
258 e_RunMode m_forceRunMode;
259 e_RunMode m_defaultRunMode;
260 e_AutoTuneMode m_autoTune;
262 int m_wgPerComputeUnit;
263 e_WaitMode m_waitMode;