-
Notifications
You must be signed in to change notification settings - Fork 555
Expand file tree
/
Copy pathParam.cpp
More file actions
32 lines (28 loc) · 869 Bytes
/
Copy pathParam.cpp
File metadata and controls
32 lines (28 loc) · 869 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) 2022, 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 oneapi {
template<typename T>
Param<T> makeParam(sycl::buffer<T> &mem, int off, const int dims[4],
const int strides[4]) {
Param<T> 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 oneapi
} // namespace arrayfire