hipLaunchByPtr and hipLaunchKernel deviceId potential issue

Those APIs should look at the device associated with the stream first.
If that stream is null then get the current device ID.

Change-Id: Iedde1d1644818ba64f128b988f0bd9674f5b8ad6
Este commit está contenido en:
Christophe Paquot
2020-02-13 10:44:10 -08:00
padre f456989339
commit cc63d2d7b8
Se han modificado 3 ficheros con 12 adiciones y 9 borrados
+3 -3
Ver fichero
@@ -50,8 +50,8 @@ void syncStreams() {
}
}
Stream::Stream(amd::Device* dev, amd::Context* ctx, amd::CommandQueue::Priority p, unsigned int f) :
queue(nullptr), device(dev), context(ctx), priority(p), flags(f) {}
Stream::Stream(amd::Device* dev, amd::Context* ctx, amd::CommandQueue::Priority p, unsigned int f, int d) :
queue(nullptr), device(dev), context(ctx), priority(p), flags(f), deviceId(d) {}
void Stream::create() {
cl_command_queue_properties properties = CL_QUEUE_PROFILING_ENABLE;
@@ -95,7 +95,7 @@ void CL_CALLBACK ihipStreamCallback(cl_event event, cl_int command_exec_status,
static hipError_t ihipStreamCreate(hipStream_t *stream, unsigned int flags, amd::CommandQueue::Priority priority) {
amd::Device* device = hip::getCurrentContext()->devices()[0];
hip::Stream* hStream = new hip::Stream(device, hip::getCurrentContext(), priority, flags);
hip::Stream* hStream = new hip::Stream(device, hip::getCurrentContext(), priority, flags, ihipGetDevice());
if (hStream == nullptr) {
return hipErrorOutOfMemory;