Skip to content

Commit

Permalink
[REFACTOR][FFI] Make more clear naming for C API Type codes. (apache#…
Browse files Browse the repository at this point in the history
…4715)

This PR introduces more clear naming prefix for C API type codes
to avoid conflict with other packages.

We also removed TVMArray and TVMType to directly use DLTensor and DLDataType.
  • Loading branch information
tqchen authored Jan 16, 2020
1 parent e7e5f79 commit 57f9d7f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/device_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class VTADeviceAPI final : public DeviceAPI {
void* AllocDataSpace(TVMContext ctx,
size_t size,
size_t alignment,
TVMType type_hint) final {
DLDataType type_hint) final {
return VTABufferAlloc(size);
}

Expand All @@ -60,7 +60,7 @@ class VTADeviceAPI final : public DeviceAPI {
size_t size,
TVMContext ctx_from,
TVMContext ctx_to,
TVMType type_hint,
DLDataType type_hint,
TVMStreamHandle stream) final {
int kind_mask = 0;
if (ctx_from.device_type != kDLCPU) {
Expand All @@ -77,7 +77,7 @@ class VTADeviceAPI final : public DeviceAPI {
void StreamSync(TVMContext ctx, TVMStreamHandle stream) final {
}

void* AllocWorkspace(TVMContext ctx, size_t size, TVMType type_hint) final;
void* AllocWorkspace(TVMContext ctx, size_t size, DLDataType type_hint) final;

void FreeWorkspace(TVMContext ctx, void* data) final;

Expand All @@ -93,7 +93,7 @@ struct VTAWorkspacePool : public WorkspacePool {
WorkspacePool(kDLExtDev, VTADeviceAPI::Global()) {}
};

void* VTADeviceAPI::AllocWorkspace(TVMContext ctx, size_t size, TVMType type_hint) {
void* VTADeviceAPI::AllocWorkspace(TVMContext ctx, size_t size, DLDataType type_hint) {
return dmlc::ThreadLocalStore<VTAWorkspacePool>::Get()
->AllocWorkspace(ctx, size);
}
Expand Down

0 comments on commit 57f9d7f

Please sign in to comment.