Loading graph_driver/xrays.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -74,7 +74,8 @@ void trace_ray(const size_t num_times, for (size_t j = 0; j < local_num_rays; j++) { omega->set(j, static_cast<T> (norm_dist1(engine))); y->set(j, static_cast<T> (norm_dist2(engine))); x->set(j, static_cast<T> (2.5*cos(norm_dist2(engine)/2.5))); y->set(j, static_cast<T> (2.5*sin(norm_dist2(engine)/2.5))); z->set(j, static_cast<T> (norm_dist2(engine))); ky->set(j, static_cast<T> (norm_dist3(engine))); kz->set(j, static_cast<T> (norm_dist4(engine))); Loading @@ -91,13 +92,13 @@ void trace_ray(const size_t num_times, for (size_t j = 0; j < local_num_rays; j++) { omega->set(j, static_cast<T> (norm_dist1(engine))); y->set(j, static_cast<T> (norm_dist2(engine))); x->set(j, static_cast<T> (2.5*cos(norm_dist2(engine)/2.5))); y->set(j, static_cast<T> (2.5*sin(norm_dist2(engine)/2.5))); z->set(j, static_cast<T> (norm_dist2(engine))); ky->set(j, static_cast<T> (norm_dist3(engine))); kz->set(j, static_cast<T> (norm_dist4(engine))); } } x->set(static_cast<T> (2.5)); kx->set(static_cast<T> (-700)); auto eq = equilibrium::make_efit<T, SAFE_MATH> (NC_FILE); Loading Loading @@ -249,7 +250,7 @@ void calculate_power(const size_t num_times, stream.str(), local_num_rays, thread_number); root.compile(); for (size_t j = 0; j < num_steps; j++) { for (size_t j = 0, je = num_steps + 1; j < je; j++) { root.run(j); } }, i, threads.size()); Loading graph_framework/absorption.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,7 @@ namespace absorption { inputs.push_back(graph::variable_cast(this->t)); inputs.push_back(graph::variable_cast(this->w)); solver::newton(work, {kamp}, inputs, {D.get_d()*D.get_d()}); solver::newton(work, {kamp}, inputs, {D.get_d()}); } //------------------------------------------------------------------------------ Loading graph_framework/cpu_context.hpp +12 −0 Original line number Diff line number Diff line Loading @@ -246,6 +246,18 @@ namespace gpu { std::cout << std::endl; } //------------------------------------------------------------------------------ /// @brief Check the value. /// /// @params[in] index Ray index to check value for. /// @params[in] node Node to check the value for. /// @returns The value at the index. //------------------------------------------------------------------------------ T check_value(const size_t index, const graph::shared_leaf<T, SAFE_MATH> &node) { return kernel_arguments[node.get()][index]; } //------------------------------------------------------------------------------ /// @brief Copy buffer contents to the device. /// Loading graph_framework/cuda_context.hpp +13 −0 Original line number Diff line number Diff line Loading @@ -390,6 +390,19 @@ namespace gpu { std::cout << std::endl; } //------------------------------------------------------------------------------ /// @brief Check the value. /// /// @params[in] index Ray index to check value for. /// @params[in] node Node to check the value for. /// @returns The value at the index. //------------------------------------------------------------------------------ T check_value(const size_t index, const graph::shared_leaf<T, SAFE_MATH> &node) { wait(); return reinterpret_cast<T *> (kernel_arguments[node.get()])[index]; } //------------------------------------------------------------------------------ /// @brief Copy buffer contents to the device. /// Loading graph_framework/dispersion.hpp +2 −3 Original line number Diff line number Diff line Loading @@ -159,20 +159,19 @@ namespace dispersion { const size_t index=0, const typename DISPERSION_FUNCTION::base tolarance = 1.0E-30, const size_t max_iterations = 1000) { auto loss = D*D; auto x_var = graph::variable_cast(x); workflow::manager<typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math> work(index); solver::newton(work, {x}, inputs, loss, tolarance, max_iterations); solver::newton(work, {x}, inputs, this->D, tolarance, max_iterations); work.compile(); work.run(); work.copy_to_host(x, x_var->data()); return loss; return this->D*this->D; } //------------------------------------------------------------------------------ Loading Loading
graph_driver/xrays.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -74,7 +74,8 @@ void trace_ray(const size_t num_times, for (size_t j = 0; j < local_num_rays; j++) { omega->set(j, static_cast<T> (norm_dist1(engine))); y->set(j, static_cast<T> (norm_dist2(engine))); x->set(j, static_cast<T> (2.5*cos(norm_dist2(engine)/2.5))); y->set(j, static_cast<T> (2.5*sin(norm_dist2(engine)/2.5))); z->set(j, static_cast<T> (norm_dist2(engine))); ky->set(j, static_cast<T> (norm_dist3(engine))); kz->set(j, static_cast<T> (norm_dist4(engine))); Loading @@ -91,13 +92,13 @@ void trace_ray(const size_t num_times, for (size_t j = 0; j < local_num_rays; j++) { omega->set(j, static_cast<T> (norm_dist1(engine))); y->set(j, static_cast<T> (norm_dist2(engine))); x->set(j, static_cast<T> (2.5*cos(norm_dist2(engine)/2.5))); y->set(j, static_cast<T> (2.5*sin(norm_dist2(engine)/2.5))); z->set(j, static_cast<T> (norm_dist2(engine))); ky->set(j, static_cast<T> (norm_dist3(engine))); kz->set(j, static_cast<T> (norm_dist4(engine))); } } x->set(static_cast<T> (2.5)); kx->set(static_cast<T> (-700)); auto eq = equilibrium::make_efit<T, SAFE_MATH> (NC_FILE); Loading Loading @@ -249,7 +250,7 @@ void calculate_power(const size_t num_times, stream.str(), local_num_rays, thread_number); root.compile(); for (size_t j = 0; j < num_steps; j++) { for (size_t j = 0, je = num_steps + 1; j < je; j++) { root.run(j); } }, i, threads.size()); Loading
graph_framework/absorption.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,7 @@ namespace absorption { inputs.push_back(graph::variable_cast(this->t)); inputs.push_back(graph::variable_cast(this->w)); solver::newton(work, {kamp}, inputs, {D.get_d()*D.get_d()}); solver::newton(work, {kamp}, inputs, {D.get_d()}); } //------------------------------------------------------------------------------ Loading
graph_framework/cpu_context.hpp +12 −0 Original line number Diff line number Diff line Loading @@ -246,6 +246,18 @@ namespace gpu { std::cout << std::endl; } //------------------------------------------------------------------------------ /// @brief Check the value. /// /// @params[in] index Ray index to check value for. /// @params[in] node Node to check the value for. /// @returns The value at the index. //------------------------------------------------------------------------------ T check_value(const size_t index, const graph::shared_leaf<T, SAFE_MATH> &node) { return kernel_arguments[node.get()][index]; } //------------------------------------------------------------------------------ /// @brief Copy buffer contents to the device. /// Loading
graph_framework/cuda_context.hpp +13 −0 Original line number Diff line number Diff line Loading @@ -390,6 +390,19 @@ namespace gpu { std::cout << std::endl; } //------------------------------------------------------------------------------ /// @brief Check the value. /// /// @params[in] index Ray index to check value for. /// @params[in] node Node to check the value for. /// @returns The value at the index. //------------------------------------------------------------------------------ T check_value(const size_t index, const graph::shared_leaf<T, SAFE_MATH> &node) { wait(); return reinterpret_cast<T *> (kernel_arguments[node.get()])[index]; } //------------------------------------------------------------------------------ /// @brief Copy buffer contents to the device. /// Loading
graph_framework/dispersion.hpp +2 −3 Original line number Diff line number Diff line Loading @@ -159,20 +159,19 @@ namespace dispersion { const size_t index=0, const typename DISPERSION_FUNCTION::base tolarance = 1.0E-30, const size_t max_iterations = 1000) { auto loss = D*D; auto x_var = graph::variable_cast(x); workflow::manager<typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math> work(index); solver::newton(work, {x}, inputs, loss, tolarance, max_iterations); solver::newton(work, {x}, inputs, this->D, tolarance, max_iterations); work.compile(); work.run(); work.copy_to_host(x, x_var->data()); return loss; return this->D*this->D; } //------------------------------------------------------------------------------ Loading