SWDEV-342025 - Fix hipEventCreateWithFlags API

- Return hipErrorInvalidValue if hipEventInterprocess flag is set, but hipEventDisableTiming flag isn't set

Change-Id: Ifbb9d83b018c360f312083bb25dba1187bcdaefa
This commit is contained in:
Rakesh Roy authored and Rakesh Roy committed 2022-06-21 10:59:17 -04:00
1 förälder 5d385fa0e2
incheckning 21d7f35c84
1 file changed
+4 -1
+4 -1
Visa fil
@@ -261,7 +261,10 @@ hipError_t ihipEventCreateWithFlags(hipEvent_t* event, unsigned flags) {
const unsigned releaseFlags = (hipEventReleaseToDevice | hipEventReleaseToSystem);
// can't set any unsupported flags.
// can't set both release flags
const bool illegalFlags = (flags & ~supportedFlags) || (flags & releaseFlags) == releaseFlags;
// if hipEventInterprocess flag is set, then hipEventDisableTiming flag also must be set
const bool illegalFlags = (flags & ~supportedFlags) ||
((flags & releaseFlags) == releaseFlags) ||
((flags & hipEventInterprocess) && !(flags & hipEventDisableTiming));
if (!illegalFlags) {
hip::Event* e = nullptr;
if (flags & hipEventInterprocess) {