Add hipDeviceSchedule* support to queue wait

Change-Id: Iffa7a356500b026f3737c3f5719ca9f62b10d855


[ROCm/hip commit: 261ff423e1]
Этот коммит содержится в:
Ben Sander
2016-10-17 19:59:36 -05:00
родитель 35801146d2
Коммит 02123ae867
4 изменённых файлов: 77 добавлений и 12 удалений
+20 -2
Просмотреть файл
@@ -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;
}