openjij
Framework for the Ising model and QUBO.
Loading...
Searching...
No Matches
chimera_gpu_classical.hpp
Go to the documentation of this file.
1// Copyright 2023 Jij Inc.
2
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6
7// http://www.apache.org/licenses/LICENSE-2.0
8
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef OPENJIJ_SYSTEM_CHIMERA_GPU_CLASSICAL_HPP__
16#define OPENJIJ_SYSTEM_CHIMERA_GPU_CLASSICAL_HPP__
17
18#ifdef USE_CUDA
19
20#include <cstddef>
21
24
25namespace openjij {
26namespace system {
27
35template <typename FloatType, std::size_t rows_per_block = 2,
36 std::size_t cols_per_block = 2>
37struct ChimeraClassicalGPU
38 : public ChimeraTransverseGPU<FloatType, rows_per_block, cols_per_block,
39 1> {
40 using system_type = classical_system;
41 using Base =
42 ChimeraTransverseGPU<FloatType, rows_per_block, cols_per_block, 1>;
43
51 ChimeraClassicalGPU(const graph::Spins &init_spin,
52 const graph::Chimera<FloatType> &init_interaction,
53 int device_num = 0)
54 : Base(init_spin, init_interaction, 1.0, 1, device_num) {}
55
61 void reset_spins(const graph::Spins &init_spin) {
62 Base::reset_spins(init_spin);
63 }
64};
65
78template <std::size_t rows_per_block = 2, std::size_t cols_per_block = 2,
79 typename FloatType>
80ChimeraClassicalGPU<FloatType, rows_per_block, cols_per_block>
81make_chimera_classical_gpu(const graph::Spins &init_spin,
82 const graph::Chimera<FloatType> &init_interaction,
83 int device_num = 0) {
84 return ChimeraClassicalGPU<FloatType, rows_per_block, cols_per_block>(
85 init_spin, init_interaction, device_num);
86}
87
88} // namespace system
89} // namespace openjij
90
91#endif
92#endif
auto json_parse(const json &obj, bool relabel=true)
parse json object from bqm.to_serializable
Definition parse.hpp:50
std::vector< Spin > Spins
Definition graph.hpp:27
Definition algorithm.hpp:24
double FloatType
Note:
Definition compile_config.hpp:37