-
Notifications
You must be signed in to change notification settings - Fork 555
Expand file tree
/
Copy pathParam.cpp
More file actions
32 lines (29 loc) · 980 Bytes
/
Copy pathParam.cpp
File metadata and controls
32 lines (29 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <Param.hpp>
#include <kernel/KParam.hpp>
#include <platform.hpp>
#include <af/defines.h>
namespace arrayfire {
namespace opencl {
Param::Param() : data(nullptr), info{{0, 0, 0, 0}, {0, 0, 0, 0}, 0} {}
Param::Param(cl::Buffer *data_, KParam info_) : data(data_), info(info_) {}
Param makeParam(cl::Buffer &mem, int off, const int dims[4],
const int strides[4]) {
Param out;
out.data = &mem;
out.info.offset = off;
for (int i = 0; i < 4; i++) {
out.info.dims[i] = dims[i];
out.info.strides[i] = strides[i];
}
return out;
}
} // namespace opencl
} // namespace arrayfire