SWDEV-342025 - Fix hipEventCreateWithFlags API

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

Change-Id: Ifbb9d83b018c360f312083bb25dba1187bcdaefa


[ROCm/clr commit: 21d7f35c84]
This commit is contained in:
Rakesh Roy
2022-06-20 21:33:24 +05:30
gecommit door Rakesh Roy
bovenliggende a223c541ca
commit 7d378eccef
@@ -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) {