Files
triton/include/isaac/driver/buffer.h

55 lines
1.6 KiB
C
Raw Normal View History

2017-01-17 20:25:28 -05:00
/* Copyright 2015-2017 Philippe Tillet
2017-05-07 16:51:51 -07:00
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
2017-01-17 20:25:28 -05:00
* subject to the following conditions:
2017-05-07 16:51:51 -07:00
*
* The above copyright notice and this permission notice shall be
2017-01-17 20:25:28 -05:00
* included in all copies or substantial portions of the Software.
2017-05-07 16:51:51 -07:00
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2017-01-17 20:25:28 -05:00
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
2017-05-07 16:51:51 -07:00
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2017-01-17 20:25:28 -05:00
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef ISAAC_DRIVER_BUFFER_H
#define ISAAC_DRIVER_BUFFER_H
#include "isaac/driver/handle.h"
2017-05-11 16:11:40 -07:00
#include "isaac/driver/context.h"
2017-05-07 16:51:51 -07:00
namespace isaac
{
namespace driver
{
2017-05-07 16:51:51 -07:00
class Stream;
// Buffer
class Buffer: public HandleInterface<Buffer, CUdeviceptr>
{
public:
Buffer(Context const & context, size_t size);
Buffer(Context const & context, CUdeviceptr cu, bool take_ownership);
2017-09-03 20:10:26 -04:00
void set_zero(Stream const & queue, size_t size);
Handle<CUdeviceptr> const & cu() const;
Handle<CUdeviceptr> & cu();
2017-05-07 16:51:51 -07:00
private:
2017-05-11 16:11:40 -07:00
Context context_;
Handle<CUdeviceptr> cu_;
};
}
}
#endif