Introducing hip::Device which wraps around amd::Context and deviceId

Change-Id: Ie35a6edb65c001b35eb9f5d2af26e765dc41c00e
Цей коміт міститься в:
Christophe Paquot authored and Christophe Paquot committed 2020-02-18 17:18:56 -05:00
1 джерело e066cc6f60
коміт b4ad4262cc
9 files changed
+145 -120

No files matched your search

+4 -6
Переглянути файл
@@ -50,12 +50,12 @@ void syncStreams() {
}
}
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) {}
Stream::Stream(hip::Device* dev, amd::CommandQueue::Priority p, unsigned int f) :
queue(nullptr), device(dev), priority(p), flags(f) {}
void Stream::create() {
cl_command_queue_properties properties = CL_QUEUE_PROFILING_ENABLE;
queue = new amd::HostQueue(*context, *device, properties,
queue = new amd::HostQueue(*device->asContext(), *device->devices()[0], properties,
amd::CommandQueue::RealTimeDisabled, priority);
assert(queue != nullptr);
queue->create();
@@ -93,9 +93,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, ihipGetDevice());
hip::Stream* hStream = new hip::Stream(hip::getCurrentDevice(), priority, flags);
if (hStream == nullptr) {
return hipErrorOutOfMemory;