This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vexcl/vexcl.hpp> | |
vex::vector<cl_float2> | |
hilbert(vex::vector<float> &in, std::size_t rows, std::size_t cols) { | |
// No need to pass context in: | |
const auto &ctx = in.queue_list(); | |
// Use function instead of vector. Should save global memory IO. | |
VEX_FUNCTION(h, float(size_t/*prm1 = idx*/, size_t/*prm2 = rows*/), | |
VEX_STRINGIZE_SOURCE( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <algorithm> | |
#include <cstdlib> | |
#include <vexcl/vexcl.hpp> | |
typedef cl_uint val_type; | |
int main() { | |
const size_t n = 1024; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vexcl/vexcl.hpp> | |
typedef int val_type; | |
typedef vex::cl_vector_of<val_type, 2>::type Tuple; | |
struct less { | |
typedef bool result_type; | |
VEX_FUNCTION(device, bool(Tuple, Tuple), | |
"return (prm1.x == prm2.x) ? (prm1.y < prm2.y) : (prm1.x < prm2.x);" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <mpi.h> | |
#include <boost/timer/timer.hpp> | |
int main(int argc, char *argv[]) { | |
MPI_Init(&argc, &argv); | |
int rank, size; | |
MPI_Comm_rank(MPI_COMM_WORLD, &rank); | |
MPI_Comm_size(MPI_COMM_WORLD, &size); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <iostream> | |
#include <fstream> | |
#include <boost/program_options.hpp> | |
namespace config { | |
int int_option1 = 1; | |
int int_option2 = 2; | |
float float_option1 = 4.2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
solve: solve.cpp | |
g++ -o solve -std=c++11 -O3 solve.cpp \ | |
-I${HOME}/work/amgcl -I/usr/include/eigen3 \ | |
-l boost_system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fft-example: fft-example.cpp | |
g++ -o $@ $^ -std=c++11 -I${HOME}/work/vexcl -lOpenCL -lboost_system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run: | |
@g++ -E pp.cpp | tail -n 1 | clang-format | pygmentize -l cpp | |
check: | |
@g++ -E pp.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: backend_cuda backend_cl | |
backend_cuda: backends.cpp | |
g++ -o $@ $^ -std=c++11 -I${HOME}/work/vexcl -lboost_system \ | |
-DVEXCL_BACKEND_CUDA -I/opt/cuda/include -lcuda -lboost_filesystem | |
backend_cl: backends.cpp | |
g++ -o $@ $^ -std=c++11 -I${HOME}/work/vexcl -lboost_system \ | |
-DVEXCL_BACKEND_VEXCL -lOpenCL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vexcl/vexcl.hpp> | |
int main() { | |
const size_t n = 16; | |
std::unique_ptr< vex::vector<int> > x; | |
{ | |
vex::Context ctx(vex::Filter::Env); | |
std::cout << ctx << std::endl; |
OlderNewer