Skip to content

Commit

Permalink
Fix unused result warnings (#802)
Browse files Browse the repository at this point in the history
Fix several unused result warnings

---------

Co-authored-by: Xavier Dupré <xadupre@users.noreply.github.com>
  • Loading branch information
skyline75489 and xadupre authored Sep 25, 2024
1 parent f204a4c commit f90a046
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/custom_op/custom_op_lite.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,16 +458,16 @@ class OrtGraphCudaKernelContext : public CUDAKernelContext {
static const int cuda_resource_ver = 1;

OrtGraphCudaKernelContext(const OrtApi& ort_api, const OrtKernelContext& ctx) : api_(ort_api) {
api_.KernelContext_GetResource(&ctx, cuda_resource_ver, CudaResource::cuda_handle_t, &cuda_stream_);
if (!cuda_stream_) {
OrtStatusPtr result = api_.KernelContext_GetResource(&ctx, cuda_resource_ver, CudaResource::cuda_handle_t, &cuda_stream_);
if (result || !cuda_stream_) {
ORTX_CXX_API_THROW("Failed to fetch cuda stream from context", ORT_RUNTIME_EXCEPTION);
}
api_.KernelContext_GetResource(&ctx, cuda_resource_ver, CudaResource::cublas_handle_t, &cublas_);
if (!cublas_) {
result = api_.KernelContext_GetResource(&ctx, cuda_resource_ver, CudaResource::cublas_handle_t, &cublas_);
if (result || !cublas_) {
ORTX_CXX_API_THROW("Failed to fetch cublas handle from context", ORT_RUNTIME_EXCEPTION);
}
void* resource = nullptr;
OrtStatusPtr result = api_.KernelContext_GetResource(&ctx, cuda_resource_ver, CudaResource::device_id_t, &resource);
result = api_.KernelContext_GetResource(&ctx, cuda_resource_ver, CudaResource::device_id_t, &resource);
if (result) {
ORTX_CXX_API_THROW("Failed to fetch device id from context", ORT_RUNTIME_EXCEPTION);
}
Expand Down

0 comments on commit f90a046

Please sign in to comment.