-
-
Notifications
You must be signed in to change notification settings - Fork 526
Expand file tree
/
Copy pathdevice_fill.cu
More file actions
29 lines (24 loc) · 769 Bytes
/
device_fill.cu
File metadata and controls
29 lines (24 loc) · 769 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
// Copyright (c) 2025 Aditya Sapra
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include <hpx/algorithm.hpp>
#include <hpx/execution.hpp>
#include <hpx/init.hpp>
#include <hpx/thrust/algorithms.hpp>
#include <hpx/thrust/policy.hpp>
#include <thrust/device_vector.h>
int hpx_main(int, char**)
{
hpx::thrust::thrust_device_policy device{};
thrust::device_vector<int> v(1024, 0);
hpx::fill(device, v.begin(), v.end(), 1);
return hpx::local::finalize();
}
int main(int argc, char** argv)
{
hpx::local::init_params init_args;
return hpx::local::init(hpx_main, argc, argv, init_args);
}