Skip to content

Commit

Permalink
* Lint error.
Browse files Browse the repository at this point in the history
  • Loading branch information
srkreddy1238 committed Dec 22, 2022
1 parent ba80b5e commit 901b189
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/runtime/opencl/opencl_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class OpenCLWorkspace : public DeviceAPI {
void* AllocDataSpace(Device dev, size_t size, size_t alignment, DLDataType type_hint) final;
void* AllocDataSpace(Device dev, int ndim, const int64_t* shape, DLDataType dtype,
Optional<String> mem_scope = NullOpt) final;
void* GetNativePtr(tvm::runtime::NDArray &narr);
void* GetNativePtr(const tvm::runtime::NDArray& narr);
void FreeDataSpace(Device dev, void* ptr) final;
void StreamSync(Device dev, TVMStreamHandle stream) final;
void* AllocWorkspace(Device dev, size_t size, DLDataType type_hint) final;
Expand All @@ -312,7 +312,7 @@ class OpenCLWorkspace : public DeviceAPI {

void CopyDataFromTo(DLTensor* from, DLTensor* to, TVMStreamHandle stream) final;

void* CreateHostPtrIfEnabled(BufferDescriptor *desc, Device dev, size_t size);
void* CreateHostPtrIfEnabled(BufferDescriptor* desc, Device dev, size_t size);

private:
std::string GetError() {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/opencl/opencl_device_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void* OpenCLWorkspace::AllocDataSpace(Device dev, int ndim, const int64_t* shape
return desc;
}

void* OpenCLWorkspace::GetNativePtr(tvm::runtime::NDArray &narr) {
void* OpenCLWorkspace::GetNativePtr(const tvm::runtime::NDArray& narr) {
cl::BufferDescriptor* desc = static_cast<cl::BufferDescriptor*>(narr.operator->()->data);
return desc->host_ptr;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/cpp-runtime/opencl/opencl_nativeptr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ TEST(OpenCLNDArray, native_ptr) {
OpenCLWorkspace* workspace = OpenCLWorkspace::Global();

auto A = tvm::runtime::NDArray::Empty({128, 128}, {kDLFloat, 32, 1}, {kDLOpenCL, 0});
void *nptr = workspace->GetNativePtr(A);
memset(nptr, 0x0, 128*128*4);
void* nptr = workspace->GetNativePtr(A);
memset(nptr, 0x0, 128 * 128 * 4);
}
#endif

0 comments on commit 901b189

Please sign in to comment.