    

 ## On this page

  

 

 # api\_device\_triangles

 Last update: 17.07.2025 

<a id="l00001" name="l00001"></a> 1\#pragma once

<a id="l00002" name="l00002"></a> 2 

<a id="l00003" name="l00003"></a> 3\#include &lt;rocky20/api/rocky\_model\_api.hpp&gt;

<a id="l00004" name="l00004"></a> 4 

<a id="l00005" name="l00005"></a> 5namespace device

<a id="l00006" name="l00006"></a> 6{

<a id="l00007" name="l00007"></a> 7 

<a id="l00008" name="l00008"></a> 8template &lt;class backend, typename Callable&gt;

<a id="l00009" name="l00009"></a> 9__global__ void execute_triangles_function(

<a id="l00010" name="l00010"></a> 10 SDeviceModel* device_data, double current_time,

<a id="l00011" name="l00011"></a> 11 Callable triangle_f_ptr,

<a id="l00012" name="l00012"></a> 12 void* udf_data

<a id="l00013" name="l00013"></a> 13)

<a id="l00014" name="l00014"></a> 14{

<a id="l00015" name="l00015"></a> 15 [IRockyDeviceModel](structIRockyDeviceModel.xhtml) device_model_api;

<a id="l00016" name="l00016"></a> 16 device_model_api._impl.model = device_data;

<a id="l00017" name="l00017"></a> 17 device_model_api._impl.current_time = current_time;

<a id="l00018" name="l00018"></a> 18 

<a id="l00019" name="l00019"></a> 19 const cuda_general&amp; general = device_data-&gt;get_general();

<a id="l00020" name="l00020"></a> 20 

<a id="l00021" name="l00021"></a> 21 int thread_start, thread_step, thread_stop;

<a id="l00022" name="l00022"></a> 22 backend::ThreadIteration(thread_start, thread_step, thread_stop, general.ntrn_active);

<a id="l00023" name="l00023"></a> 23 for (int i = thread_start; i &lt; thread_stop; i += thread_step)

<a id="l00024" name="l00024"></a> 24 {

<a id="l00025" name="l00025"></a> 25 [IRockyBoundaryTriangle](structIRockyGeometryTriangle.xhtml) triangle_api(i, device_data);

<a id="l00026" name="l00026"></a> 26 triangle_f_ptr(device_model_api, triangle_api, udf_data);

<a id="l00027" name="l00027"></a> 27 }

<a id="l00028" name="l00028"></a> 28}

<a id="l00029" name="l00029"></a> 29 

<a id="l00030" name="l00030"></a> 30} // namespace device

[IRockyDeviceModel](structIRockyDeviceModel.xhtml)

**Definition** rocky_model_api.hpp:19



[IRockyGeometryTriangle](structIRockyGeometryTriangle.xhtml)

**Definition** rocky_boundary_api.hpp:134