BlackCat_Tensors
A GPU-supported autograd and linear algebra library, designed for neural network construction
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Namespaces | Macros | Typedefs | Functions
common.h File Reference
#include <type_traits>
#include <cstdio>
#include <iostream>
#include <cublas.h>
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  bc::system_tag_base
 
struct  bc::system_tag_type< DerivedTag >
 
struct  bc::host_tag
 
struct  bc::device_tag
 
struct  bc::is_system_tag< T >
 

Namespaces

 bc
 The Evaluator determines if an expression needs to be greedily optimized.
 
 bc::detail
 

Macros

#define BC_DEFAULT_SYSTEM_TAG   host_tag
 
#define BC_IF_CUDA(...)   __VA_ARGS__
 
#define BC_IF_NO_CUDA(...)
 
#define BCHOSTDEV   __host__ __device__
 
#define BCINLINE   BCHOSTDEV inline
 
#define BCHOT   inline
 
#define BC_NO_UNIQUE_ADDRESS
 
#define BC_ASSERT(condition, message)   { bc::bc_assert(condition, message, __FILE__, __PRETTY_FUNCTION__, __LINE__); }
 
#define BC_CUDA_ASSERT(...)   { BC_cuda_assert((__VA_ARGS__), __FILE__, __PRETTY_FUNCTION__, __LINE__); }
 
#define BC_omp_async__(...)   __VA_ARGS__
 
#define BC_omp_parallel__
 
#define BC_omp_atomic__
 
#define BC_omp_for__
 
#define BC_omp_bar__
 
#define BC_omp_for_reduction__(oper, value)
 
#define BC_SIZE_T   int
 
#define BC_CUDA_KERNEL_LOOP_XYZ(i, n, xyz)
 
#define BC_CUDA_KERNEL_LOOP_X(i, n)   BC_CUDA_KERNEL_LOOP_XYZ(i,n,x)
 
#define BC_CUDA_KERNEL_LOOP_Y(i, n)   BC_CUDA_KERNEL_LOOP_XYZ(i,n,y)
 
#define BC_CUDA_KERNEL_LOOP_Z(i, n)   BC_CUDA_KERNEL_LOOP_XYZ(i,n,z)
 

Typedefs

using bc::default_system_tag_t = host_tag
 
using bc::size_t = int
 

Functions

template<class RM_UNUSED_FUNCTION_WARNING = void>
void bc::set_print_stream (std::ostream *ostream)
 
template<class RM_UNUSED_FUNCTION_WARNING = void>
std::ostream * bc::get_print_stream ()
 
template<class RM_UNUSED_FUNCTION_WARNING = void>
void bc::set_error_stream (std::ostream *ostream)
 
template<class RM_UNUSED_FUNCTION_WARNING = void>
std::ostream * bc::get_error_stream ()
 
template<class T = char>
void bc::detail::print_impl (std::ostream *os, const T &arg='\n')
 
template<class T , class... Ts>
void bc::detail::print_impl (std::ostream *os, const T &arg, const Ts &... args)
 
template<class... Ts>
void bc::print (const Ts &... args)
 
template<class... Ts>
void bc::printerr (const Ts &... args)
 
template<class str_type >
void bc::bc_assert (bool condition, str_type msg, const char *file, const char *function, int line)
 
void bc::BC_cuda_assert (cudaError_t code, const char *file, const char *function, int line)
 
void bc::BC_cuda_assert (cublasStatus_t code, const char *file, const char *function, int line)
 
template<class T >
const char * bc::bc_get_classname_of (const T &arg)
 

Macro Definition Documentation

◆ BC_ASSERT

#define BC_ASSERT (   condition,
  message 
)    { bc::bc_assert(condition, message, __FILE__, __PRETTY_FUNCTION__, __LINE__); }

◆ BC_CUDA_ASSERT

#define BC_CUDA_ASSERT (   ...)    { BC_cuda_assert((__VA_ARGS__), __FILE__, __PRETTY_FUNCTION__, __LINE__); }

◆ BC_CUDA_KERNEL_LOOP_X

#define BC_CUDA_KERNEL_LOOP_X (   i,
 
)    BC_CUDA_KERNEL_LOOP_XYZ(i,n,x)

◆ BC_CUDA_KERNEL_LOOP_XYZ

#define BC_CUDA_KERNEL_LOOP_XYZ (   i,
  n,
  xyz 
)
Value:
for (int i = blockIdx.xyz * blockDim.xyz + threadIdx.xyz; \
i < (n); \
i += blockDim.xyz * gridDim.xyz)

◆ BC_CUDA_KERNEL_LOOP_Y

#define BC_CUDA_KERNEL_LOOP_Y (   i,
 
)    BC_CUDA_KERNEL_LOOP_XYZ(i,n,y)

◆ BC_CUDA_KERNEL_LOOP_Z

#define BC_CUDA_KERNEL_LOOP_Z (   i,
 
)    BC_CUDA_KERNEL_LOOP_XYZ(i,n,z)

◆ BC_DEFAULT_SYSTEM_TAG

#define BC_DEFAULT_SYSTEM_TAG   host_tag

◆ BC_IF_CUDA

#define BC_IF_CUDA (   ...)    __VA_ARGS__

◆ BC_IF_NO_CUDA

#define BC_IF_NO_CUDA (   ...)

◆ BC_NO_UNIQUE_ADDRESS

#define BC_NO_UNIQUE_ADDRESS

◆ BC_omp_async__

#define BC_omp_async__ (   ...)    __VA_ARGS__

◆ BC_omp_atomic__

#define BC_omp_atomic__

◆ BC_omp_bar__

#define BC_omp_bar__

◆ BC_omp_for__

#define BC_omp_for__

◆ BC_omp_for_reduction__

#define BC_omp_for_reduction__ (   oper,
  value 
)

◆ BC_omp_parallel__

#define BC_omp_parallel__

◆ BC_SIZE_T

#define BC_SIZE_T   int

◆ BCHOSTDEV

#define BCHOSTDEV   __host__ __device__

◆ BCHOT

#define BCHOT   inline

◆ BCINLINE

#define BCINLINE   BCHOSTDEV inline