BabelStream/STDStream.h
Gonzalo Brito Gadeschi 0855805ce2 Add NVIDIA HPC SDK C++ parallel STL implementation
This commits adds an implementation using the C++ parallel STL.
The Makefile uses the NVIDIA HPC SDK `nvc++` compiler with the `-stdpar` flag.
Tested using the NVIDIA HPC SDK 20.9.
2020-11-23 03:08:44 -08:00

39 lines
874 B
C++

// Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
//
// For full license terms please see the LICENSE file distributed with this
// source code
#pragma once
#include <iostream>
#include <stdexcept>
#include "Stream.h"
#define IMPLEMENTATION_STRING "STD"
template <class T>
class STDStream : public Stream<T>
{
protected:
// Size of arrays
unsigned int array_size;
// Device side pointers
T *a;
T *b;
T *c;
public:
STDStream(const unsigned int, T*, T*, T*, int);
~STDStream() = default;
virtual void copy() override;
virtual void add() override;
virtual void mul() override;
virtual void triad() override;
virtual T dot() override;
virtual void init_arrays(T initA, T initB, T initC) override;
virtual void read_arrays(std::vector<T>& a, std::vector<T>& b, std::vector<T>& c) override;
};