Add hipDeviceSchedule* support to queue wait

Change-Id: Iffa7a356500b026f3737c3f5719ca9f62b10d855
Tá an tiomantas seo le fáil i:
Ben Sander
2016-10-17 19:59:36 -05:00
tuismitheoir d21d3ec222
tiomantas 261ff423e1
D'athraigh 4 comhad le 77 breiseanna agus 12 scriosta
+20 -2
Féach ar an gComhad
@@ -268,7 +268,7 @@ hipError_t hipSetDeviceFlags( unsigned int flags)
{
HIP_INIT_API(flags);
hipError_t e;
hipError_t e = hipSuccess;
auto * ctx = ihipGetTlsDefaultCtx();
@@ -276,7 +276,25 @@ hipError_t hipSetDeviceFlags( unsigned int flags)
// TODO : Review error handling behavior for this function, it often returns ErrorSetOnActiveProcess
if (ctx) {
ctx->_ctxFlags = ctx->_ctxFlags | flags;
e = hipSuccess;
if (flags & hipDeviceScheduleMask) {
switch (hipDeviceScheduleMask) {
case hipDeviceScheduleAuto:
case hipDeviceScheduleSpin:
case hipDeviceScheduleYield:
case hipDeviceScheduleBlockingSync:
e = hipSuccess;
break;
default:
e = hipErrorInvalidValue;
break;
}
}
unsigned supportedFlags = hipDeviceScheduleMask | hipDeviceMapHost | hipDeviceLmemResizeToMax;
if (flags & ~supportedFlags) {
e = hipErrorInvalidValue;
}
} else {
e = hipErrorInvalidDevice;
}