rocPRIM
Namespaces | Macros | Functions | Variables
device_adjacent_difference.hpp File Reference

Device level adjacent_difference parallel primitives. More...

#include "detail/device_adjacent_difference.hpp"
#include "device_adjacent_difference_config.hpp"
#include "config_types.hpp"
#include "device_transform.hpp"
#include "../config.hpp"
#include "../functional.hpp"
#include "../detail/temp_storage.hpp"
#include "../detail/various.hpp"
#include "../iterator/counting_iterator.hpp"
#include "../iterator/transform_iterator.hpp"
#include <hip/hip_runtime.h>
#include <chrono>
#include <iostream>
#include <iterator>
#include <cstddef>
Include dependency graph for device_adjacent_difference.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 detail
 Deprecated: Configuration of device-level scan primitives.
 

Macros

#define ROCPRIM_DETAIL_HIP_SYNC_AND_RETURN_ON_ERROR(name, size, start)
 

Functions

template<typename Config , bool InPlace, bool Right, typename InputIt , typename OutputIt , typename BinaryFunction >
void ROCPRIM_KERNEL detail::__launch_bounds__ (Config::block_size) adjacent_difference_kernel(const InputIt input
 
template<typename Config , bool InPlace, bool Right, typename InputIt , typename OutputIt , typename BinaryFunction >
hipError_t detail::adjacent_difference_impl (void *const temporary_storage, std::size_t &storage_size, const InputIt input, const OutputIt output, const std::size_t size, const BinaryFunction op, const hipStream_t stream, const bool debug_synchronous)
 
template<typename Config = default_config, typename InputIt , typename OutputIt , typename BinaryFunction = ::rocprim::minus<>>
hipError_t adjacent_difference (void *const temporary_storage, std::size_t &storage_size, const InputIt input, const OutputIt output, const std::size_t size, const BinaryFunction op=BinaryFunction {}, const hipStream_t stream=0, const bool debug_synchronous=false)
 Parallel primitive for applying a binary operation across pairs of consecutive elements in device accessible memory. More...
 
template<typename Config = default_config, typename InputIt , typename BinaryFunction = ::rocprim::minus<>>
hipError_t adjacent_difference_inplace (void *const temporary_storage, std::size_t &storage_size, const InputIt values, const std::size_t size, const BinaryFunction op=BinaryFunction {}, const hipStream_t stream=0, const bool debug_synchronous=false)
 Parallel primitive for applying a binary operation across pairs of consecutive elements in device accessible memory. More...
 
template<typename Config = default_config, typename InputIt , typename OutputIt , typename BinaryFunction = ::rocprim::minus<>>
hipError_t adjacent_difference_right (void *const temporary_storage, std::size_t &storage_size, const InputIt input, const OutputIt output, const std::size_t size, const BinaryFunction op=BinaryFunction {}, const hipStream_t stream=0, const bool debug_synchronous=false)
 Parallel primitive for applying a binary operation across pairs of consecutive elements in device accessible memory. More...
 
template<typename Config = default_config, typename InputIt , typename BinaryFunction = ::rocprim::minus<>>
hipError_t adjacent_difference_right_inplace (void *const temporary_storage, std::size_t &storage_size, const InputIt values, const std::size_t size, const BinaryFunction op=BinaryFunction {}, const hipStream_t stream=0, const bool debug_synchronous=false)
 Parallel primitive for applying a binary operation across pairs of consecutive elements in device accessible memory. More...
 

Variables

void ROCPRIM_KERNEL const OutputIt detail::output
 
void ROCPRIM_KERNEL const OutputIt const std::size_t detail::size
 
void ROCPRIM_KERNEL const OutputIt const std::size_t const BinaryFunction detail::op
 
void ROCPRIM_KERNEL const OutputIt const std::size_t const BinaryFunction const std::iterator_traits< InputIt >::value_type * detail::previous_values
 
void ROCPRIM_KERNEL const OutputIt const std::size_t const BinaryFunction const std::iterator_traits< InputIt >::value_type const std::size_t detail::starting_block
 

Detailed Description

Device level adjacent_difference parallel primitives.

Macro Definition Documentation

◆ ROCPRIM_DETAIL_HIP_SYNC_AND_RETURN_ON_ERROR

#define ROCPRIM_DETAIL_HIP_SYNC_AND_RETURN_ON_ERROR (   name,
  size,
  start 
)
Value:
{ \
auto _error = hipGetLastError(); \
if(_error != hipSuccess) \
return _error; \
if(debug_synchronous) \
{ \
std::cout << name << "(" << size << ")"; \
auto __error = hipStreamSynchronize(stream); \
if(__error != hipSuccess) \
return __error; \
auto _end = std::chrono::high_resolution_clock::now(); \
auto _d = std::chrono::duration_cast<std::chrono::duration<double>>(_end - start); \
std::cout << " " << _d.count() * 1000 << " ms" << '\n'; \
} \
}