Ensign
Low-rank framework for multi-core CPUs and GPUs
Loading...
Searching...
No Matches
common.hpp
Go to the documentation of this file.
1
36
#pragma once
37
38
#include <iostream>
39
#include <fstream>
40
#include <cmath>
41
#include <iterator>
42
#include <array>
43
#include <vector>
44
#include <algorithm>
45
#include <assert.h>
46
#include <complex>
47
#include <string>
48
#include <memory>
49
50
#ifdef __MKL__
51
#include <mkl.h>
52
#else
53
#include <cblas.h>
54
#endif
55
#include <fftw3.h>
56
#include <functional>
57
#include <random>
58
59
#ifdef __CUDA__
60
#include <cuda_runtime.h>
61
#include "cublas_v2.h"
62
#include <cufft.h>
63
#include <curand.h>
64
#include <cusolverDn.h>
65
#endif
66
67
#ifdef __OPENMP__
68
#include <omp.h>
69
#endif
70
71
using
std::cout;
72
using
std::endl;
73
using
std::ofstream;
74
using
std::max;
75
using
std::array;
76
using
std::vector;
77
using
std::fill;
78
using
std::abs;
79
using
std::complex;
80
using
std::string;
81
using
std::to_string;
82
83
typedef
ptrdiff_t
Index
;
84
enum class
stloc
{
host
,
device
};
85
86
#ifdef __CUDA__
87
const
int
n_threads = 128;
88
#endif
89
90
#ifdef __OPENMP__
91
const
int
n_threads_omp
= 32;
92
#endif
93
94
96
namespace
Ensign
{
97
98
// make_unique implementation for compiler that do not support it yet
99
template
<
typename
T,
typename
... Args>
100
std::unique_ptr<T>
make_unique_ptr
(Args&&... args)
101
{
102
return
std::unique_ptr<T>(
new
T(std::forward<Args>(args)...));
103
}
104
105
}
// namespace Ensign
Index
ptrdiff_t Index
Definition
common.hpp:83
stloc
stloc
Definition
common.hpp:84
stloc::host
@ host
stloc::device
@ device
n_threads_omp
const int n_threads_omp
Definition
common.hpp:91
Ensign
Core namespace for Ensign's numerical algorithms and data structures.
Definition
common.hpp:96
Ensign::make_unique_ptr
std::unique_ptr< T > make_unique_ptr(Args &&... args)
Definition
common.hpp:100
include
generic
common.hpp
Generated by
1.9.8