You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I want to record all the vertex in the path. The vertex is a struct which consists of all DSL variables. However I didn't find a good way to record that in the callable as it seems like the size and the index should be determined at "compile time". Is there any suggested way of doing that?
Describe the solution you'd like
Array<Vertex> vertices(n);
...
$for(i, max_depth) {
auto v = vertices[i];
v.position = make_float3(1.0f);
}
...
Describe alternatives you've considered
I have tried linked list by using a pointer in Vertex, but this does not seem right as DSL have not actually run the code. Any suggestion on how to properly implement that will also be helpful.
The text was updated successfully, but these errors were encountered:
You may use Local<T> in <luisa/dsl/local.h> which can be constructed with runtime-specified lengths. The element type T can be any DSL type, i.e., scalars, vectors, matrices, or POD structures reflected by LUISA_STRUCT.
Example:
namespacesome {
structTest {
float a;
uint2 b;
};
} // namespace some// reflect the plain C structureLUISA_STRUCT(some::Test, a, b) {};
intmain() {
uint n = some_runtime_value();
Kernel1D kernel = [] {
Local<Test> x{n}; // construct an array with n elements of struct Test
};
}
You may use Local<T> in <luisa/dsl/local.h> which can be constructed with runtime-specified lengths. The element type T can be any DSL type, i.e., scalars, vectors, matrices, or POD structures reflected by LUISA_STRUCT.
Example:
namespacesome {
structTest {
float a;
uint2 b;
};
} // namespace some// reflect the plain C structureLUISA_STRUCT(some::Test, a, b) {};
intmain() {
uint n = some_runtime_value();
Kernel1D kernel = [] {
Local<Test> x{n}; // construct an array with n elements of struct Test
};
}
Is your feature request related to a problem? Please describe.
I want to record all the vertex in the path. The vertex is a struct which consists of all DSL variables. However I didn't find a good way to record that in the callable as it seems like the size and the index should be determined at "compile time". Is there any suggested way of doing that?
Describe the solution you'd like
Describe alternatives you've considered
I have tried linked list by using a pointer in Vertex, but this does not seem right as DSL have not actually run the code. Any suggestion on how to properly implement that will also be helpful.
The text was updated successfully, but these errors were encountered: