Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vulkan][Runtime] Added dummy implementations for TVMStreamHandle operations #7969

Merged
merged 1 commit into from
May 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions src/runtime/vulkan/vulkan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -373,29 +373,32 @@ class VulkanDeviceAPI final : public DeviceAPI {
}

public:
// Always use the default stream
TVMStreamHandle CreateStream(Device dev) {
LOG(FATAL) << "Not implemented";
return nullptr;
}

void FreeStream(Device dev, TVMStreamHandle stream) {
LOG(FATAL) << "Not implemented";
// Current vulkan implementation has one "stream" per CPU thread,
// with all commands writing into a single command buffer that is
// submitted on a call to StreamSync. Therefore, for now, these are
// mostly no-ops. If needed in the future, could have multiple
// command buffers to act as multiple streams.
TVMStreamHandle CreateStream(Device dev) final { return nullptr; }

void FreeStream(Device dev, TVMStreamHandle stream) final {
ICHECK_EQ(stream, static_cast<void*>(nullptr));
return;
}

void SyncStreamFromTo(Device dev, TVMStreamHandle event_src, TVMStreamHandle event_dst) {
LOG(FATAL) << "Not implemented";
// Syncing two streams is a nop, since there is only one stream.
void SyncStreamFromTo(Device dev, TVMStreamHandle event_src, TVMStreamHandle event_dst) final {
ICHECK_EQ(event_src, static_cast<void*>(nullptr));
ICHECK_EQ(event_dst, static_cast<void*>(nullptr));
return;
}

void StreamSync(Device dev, TVMStreamHandle stream) final {
ICHECK(stream == nullptr);
ICHECK_EQ(stream, static_cast<void*>(nullptr));
VulkanThreadEntry::ThreadLocal()->Stream(dev.device_id)->Synchronize();
}

void SetStream(Device dev, TVMStreamHandle stream) final {
LOG(FATAL) << "Not implemented";
ICHECK_EQ(stream, static_cast<void*>(nullptr));
return;
}

Expand Down