Add hipDeviceSchedule* support to queue wait

Change-Id: Iffa7a356500b026f3737c3f5719ca9f62b10d855
Tá an tiomantas seo le fáil i:
Ben Sander tiomanta 2016-10-18 22:27:16 -05:00
1 tuismitheoir 0787c41ac0
tiomantas c7303d5924
4 comhad athraithe
+77 -12

Níor tháinig aon chomhaid le do chuardach

+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;
}