User config param overhaul complete, works. If I haven't missed anything, all fields and user parameters, and everything related to simulation can now be declared with the DSL. The only thing that you need to do is to fill the declared symbols with data, like with OpenGL and GLSL.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include "stencil_definition.sdh"
|
||||
|
||||
Preprocessed Scalar
|
||||
value(in ScalarField vertex)
|
||||
{
|
||||
@@ -17,7 +19,7 @@ gradient(in ScalarField vertex)
|
||||
Preprocessed Scalar
|
||||
der6x_upwd(in ScalarField vertex)
|
||||
{
|
||||
Scalar inv_ds = DCONST_REAL(AC_inv_dsx);
|
||||
Scalar inv_ds = AC_inv_dsx;
|
||||
|
||||
return (Scalar){ Scalar(1.0/60.0)*inv_ds* (
|
||||
- Scalar(20.0)* vertex[vertexIdx.x, vertexIdx.y, vertexIdx.z]
|
||||
@@ -32,7 +34,7 @@ der6x_upwd(in ScalarField vertex)
|
||||
Preprocessed Scalar
|
||||
der6y_upwd(in ScalarField vertex)
|
||||
{
|
||||
Scalar inv_ds = DCONST_REAL(AC_inv_dsy);
|
||||
Scalar inv_ds = AC_inv_dsy;
|
||||
|
||||
return (Scalar){ Scalar(1.0/60.0)*inv_ds* (
|
||||
-Scalar( 20.0)* vertex[vertexIdx.x, vertexIdx.y, vertexIdx.z]
|
||||
@@ -47,7 +49,7 @@ der6y_upwd(in ScalarField vertex)
|
||||
Preprocessed Scalar
|
||||
der6z_upwd(in ScalarField vertex)
|
||||
{
|
||||
Scalar inv_ds = DCONST_REAL(AC_inv_dsz);
|
||||
Scalar inv_ds = AC_inv_dsz;
|
||||
|
||||
return (Scalar){ Scalar(1.0/60.0)*inv_ds* (
|
||||
-Scalar( 20.0)* vertex[vertexIdx.x, vertexIdx.y, vertexIdx.z]
|
||||
|
@@ -238,8 +238,9 @@ translate_latest_symbol(void)
|
||||
else if (symbol->type != SYMBOLTYPE_FUNCTION_PARAMETER &&
|
||||
(symbol->type_qualifier == IN || symbol->type_qualifier == OUT)) {
|
||||
|
||||
printf("static __device__ const %s %s%s", symbol->type_specifier == SCALAR ? "int" : "int3",
|
||||
inout_name_prefix, symbol_table[handle].identifier);
|
||||
printf("static __device__ const %s %s%s",
|
||||
symbol->type_specifier == SCALARFIELD ? "int" : "int3", inout_name_prefix,
|
||||
symbol_table[handle].identifier);
|
||||
if (symbol->type_specifier == VECTOR)
|
||||
printf(" = make_int3");
|
||||
}
|
||||
|
Reference in New Issue
Block a user