|
| 1 | +// Copyright 2019 Google LLC. All Rights Reserved. |
| 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 | +// https://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 | +#include "pybind_main_hip.h" |
| 16 | + |
| 17 | +#include "../../lib/simulator_cuda.h" |
| 18 | + |
| 19 | +namespace qsim { |
| 20 | + using Simulator = SimulatorCUDA<float>; |
| 21 | + |
| 22 | + struct Factory { |
| 23 | + using Simulator = qsim::Simulator; |
| 24 | + using StateSpace = Simulator::StateSpace; |
| 25 | + |
| 26 | + Factory( |
| 27 | + unsigned num_sim_threads, |
| 28 | + unsigned num_state_threads, |
| 29 | + unsigned num_dblocks |
| 30 | + ) : ss_params{num_state_threads, num_dblocks} {} |
| 31 | + |
| 32 | + StateSpace CreateStateSpace() const { |
| 33 | + return StateSpace(ss_params); |
| 34 | + } |
| 35 | + |
| 36 | + Simulator CreateSimulator() const { |
| 37 | + return Simulator(); |
| 38 | + } |
| 39 | + |
| 40 | + StateSpace::Parameter ss_params; |
| 41 | + }; |
| 42 | + |
| 43 | + inline void SetFlushToZeroAndDenormalsAreZeros() {} |
| 44 | + inline void ClearFlushToZeroAndDenormalsAreZeros() {} |
| 45 | +} |
| 46 | + |
| 47 | +#include "../pybind_main.cpp" |
0 commit comments