From abb3dc822023e5e9ce1ec16d31b27e022c40cb6b Mon Sep 17 00:00:00 2001 From: Seunghwa Kang Date: Fri, 10 May 2019 13:26:19 -0700 Subject: [PATCH] applied a fix for https://github.com/NVlabs/cub/issues/162 to cub_semiring --- .../cub_semiring/device/dispatch/dispatch_spmv_orig.cuh | 2 +- .../cub_semiring/iterator/tex_obj_input_iterator.cuh | 2 +- .../cub_semiring/iterator/tex_ref_input_iterator.cuh | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpp/nvgraph/external/cub_semiring/device/dispatch/dispatch_spmv_orig.cuh b/cpp/nvgraph/external/cub_semiring/device/dispatch/dispatch_spmv_orig.cuh index 7432d58d69a..7a4691b55c3 100644 --- a/cpp/nvgraph/external/cub_semiring/device/dispatch/dispatch_spmv_orig.cuh +++ b/cpp/nvgraph/external/cub_semiring/device/dispatch/dispatch_spmv_orig.cuh @@ -762,7 +762,7 @@ struct DispatchSpmv #if (CUB_PTX_ARCH == 0) // Init textures - if (CubDebug(error = spmv_params.t_vector_x.BindTexture(spmv_params.d_vector_x))) break; + if (CubDebug(error = spmv_params.t_vector_x.BindTexture(spmv_params.d_vector_x, spmv_params.num_cols * sizeof(ValueT)))) break; #endif if (search_grid_size < sm_count) diff --git a/cpp/nvgraph/external/cub_semiring/iterator/tex_obj_input_iterator.cuh b/cpp/nvgraph/external/cub_semiring/iterator/tex_obj_input_iterator.cuh index 623609452fd..d47b214ca82 100644 --- a/cpp/nvgraph/external/cub_semiring/iterator/tex_obj_input_iterator.cuh +++ b/cpp/nvgraph/external/cub_semiring/iterator/tex_obj_input_iterator.cuh @@ -161,7 +161,7 @@ public: template cudaError_t BindTexture( QualifiedT *ptr, ///< Native pointer to wrap that is aligned to cudaDeviceProp::textureAlignment - size_t bytes = size_t(-1), ///< Number of bytes in the range + size_t bytes, ///< Number of bytes in the range size_t tex_offset = 0) ///< OffsetT (in items) from \p ptr denoting the position of the iterator { this->ptr = const_cast::Type *>(ptr); diff --git a/cpp/nvgraph/external/cub_semiring/iterator/tex_ref_input_iterator.cuh b/cpp/nvgraph/external/cub_semiring/iterator/tex_ref_input_iterator.cuh index 0305c78cd2c..e67b52c07f0 100644 --- a/cpp/nvgraph/external/cub_semiring/iterator/tex_ref_input_iterator.cuh +++ b/cpp/nvgraph/external/cub_semiring/iterator/tex_ref_input_iterator.cuh @@ -91,13 +91,13 @@ struct IteratorTexRef static TexRef ref; /// Bind texture - static cudaError_t BindTexture(void *d_in, size_t &offset) + static cudaError_t BindTexture(void *d_in, size_t &bytes, size_t &offset) { if (d_in) { cudaChannelFormatDesc tex_desc = cudaCreateChannelDesc(); ref.channelDesc = tex_desc; - return (CubDebug(cudaBindTexture(&offset, ref, d_in))); + return (CubDebug(cudaBindTexture(&offset, ref, d_in, bytes))); } return cudaSuccess; @@ -245,12 +245,12 @@ public: template cudaError_t BindTexture( QualifiedT *ptr, ///< Native pointer to wrap that is aligned to cudaDeviceProp::textureAlignment - size_t bytes = size_t(-1), ///< Number of bytes in the range + size_t bytes, ///< Number of bytes in the range size_t tex_offset = 0) ///< OffsetT (in items) from \p ptr denoting the position of the iterator { this->ptr = const_cast::Type *>(ptr); size_t offset; - cudaError_t retval = TexId::BindTexture(this->ptr + tex_offset, offset); + cudaError_t retval = TexId::BindTexture(this->ptr + tex_offset, bytes, offset); this->tex_offset = (difference_type) (offset / sizeof(QualifiedT)); return retval; }