Fixed extra copy const call and removed warnings from examples
MODIFY
.gitlab-ci.yml
.gitlab-ci.yml
@@ -37,7 +37,7 @@ build:rocm:
script:
- mkdir build
- cd build
- - CXX=hipcc cmake -DBUILD_TEST=ON ../.
+ - CXX=hipcc cmake -DBUILD_TEST=ON -DBUILD_EXAMPLES=ON -DBUILD_BENCHMARKS=ON ../.
- make -j $(nproc)
- make package
artifacts:

MODIFY
cmake/Summary.cmake
cmake/Summary.cmake
@@ -39,4 +39,6 @@ endif()
message(STATUS " DISABLE_WERROR : ${DISABLE_WERROR}")
message(STATUS " DOWNLOAD_ROCPRIM : ${DOWNLOAD_ROCPRIM}")
message(STATUS " BUILD_TEST : ${BUILD_TEST}")
+ message(STATUS " BUILD_EXAMPLES : ${BUILD_EXAMPLES}")
+ message(STATUS " BUILD_BENCHMARKS : ${BUILD_BENCHMARKS}")
endfunction()

MODIFY
examples/device_ptr.cu
examples/device_ptr.cu
@@ -38,9 +38,11 @@ int main(void)
// back to where we started
assert(wrapped_ptr == d_ptr);
+ // Avoid warning
+ THRUST_UNUSED_VAR(wrapped_ptr);
+
// deallocate device memory
thrust::device_free(d_ptr);
return 0;
}
-

MODIFY
examples/scan_by_key.cu
examples/scan_by_key.cu
@@ -10,7 +10,7 @@ struct head_flag_predicate
: public thrust::binary_function<HeadFlagType,HeadFlagType,bool>
{
__host__ __device__
- bool operator()(HeadFlagType left, HeadFlagType right) const
+ bool operator()(HeadFlagType, HeadFlagType right) const
{
return !right;
}
@@ -90,4 +90,3 @@ int main(void)
return 0;
}
-

MODIFY
examples/uninitialized_vector.cu
examples/uninitialized_vector.cu
@@ -46,7 +46,7 @@ template<typename T>
// note that construct is annotated as
// a __host__ __device__ function
__host__ __device__
- void construct(T *p)
+ void construct(T *)
{
// no-op
}
@@ -76,4 +76,3 @@ int main()
return 0;
}
-

MODIFY
thrust/system/hip/detail/internal/copy_cross_system.h
thrust/system/hip/detail/internal/copy_cross_system.h
@@ -251,11 +251,11 @@ cross_system_copy_n(thrust::hip_rocprim::execution_policy<D>& device_s,
struct workaround
{
__host__
- static OutputIt par(thrust::hip_rocprim::execution_policy<D>& device_s,
+ static void par(thrust::hip_rocprim::execution_policy<D>& device_s,
thrust::cpp::execution_policy<H>& host_s,
InputIt first,
Size num_items,
- OutputIt result)
+ OutputIt& result)
{
#if __HCC__ && __HIP_DEVICE_COMPILE__
THRUST_HIP_PRESERVE_KERNELS_WORKAROUND(
@@ -266,30 +266,31 @@ cross_system_copy_n(thrust::hip_rocprim::execution_policy<D>& device_s,
THRUST_UNUSED_VAR(first);
THRUST_UNUSED_VAR(num_items);
#else
- return cross_system_copy_n_dh_nt(device_s, host_s, first, num_items, result);
+ result = cross_system_copy_n_dh_nt(device_s, host_s, first, num_items, result);
#endif
}
__device__
- static OutputIt seq(thrust::hip_rocprim::execution_policy<D>& device_s,
+ static void seq(thrust::hip_rocprim::execution_policy<D>& device_s,
thrust::cpp::execution_policy<H>& host_s,
InputIt first,
Size num_items,
- OutputIt result)
+ OutputIt& result)
{
THRUST_UNUSED_VAR(device_s);
THRUST_UNUSED_VAR(host_s);
THRUST_UNUSED_VAR(first);
THRUST_UNUSED_VAR(num_items);
-
- return result;
+ THRUST_UNUSED_VAR(result);
}
};
#if __THRUST_HAS_HIPRT__
- return workaround::par(device_s, host_s, first, num_items, result);
+ workaround::par(device_s, host_s, first, num_items, result);
+ return result;
#else
- return workaround::seq(device_s, host_s, first, num_items, result);
+ workaround::seq(device_s, host_s, first, num_items, result);
+ return result;
#endif
}
#endif

Fixed extra copy const call and removed warnings from examples