Add missing stream null check for some hipStreamCreate APIs
Change-Id: I716d71e4ec59b0bd7922869bfa0ed908c22c289e
This commit is contained in:
committed by
Rahul Garg
parent
797d2761d4
commit
e27d53043c
@@ -202,6 +202,10 @@ static hipError_t ihipStreamCreate(hipStream_t* stream,
|
||||
hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags) {
|
||||
HIP_INIT_API(hipStreamCreateWithFlags, stream, flags);
|
||||
|
||||
if (stream == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
HIP_RETURN(ihipStreamCreate(stream, flags, hip::Stream::Priority::Normal), *stream);
|
||||
}
|
||||
|
||||
@@ -209,6 +213,10 @@ hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags) {
|
||||
hipError_t hipStreamCreate(hipStream_t *stream) {
|
||||
HIP_INIT_API(hipStreamCreate, stream);
|
||||
|
||||
if (stream == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
HIP_RETURN(ihipStreamCreate(stream, hipStreamDefault, hip::Stream::Priority::Normal), *stream);
|
||||
}
|
||||
|
||||
@@ -216,6 +224,10 @@ hipError_t hipStreamCreate(hipStream_t *stream) {
|
||||
hipError_t hipStreamCreateWithPriority(hipStream_t* stream, unsigned int flags, int priority) {
|
||||
HIP_INIT_API(hipStreamCreateWithPriority, stream, flags, priority);
|
||||
|
||||
if (stream == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
hip::Stream::Priority streamPriority;
|
||||
if (priority <= hip::Stream::Priority::High) {
|
||||
streamPriority = hip::Stream::Priority::High;
|
||||
|
||||
Reference in New Issue
Block a user