Skip to content

Commit

Permalink
Added comments
Browse files Browse the repository at this point in the history
Co-authored-by: Natalia Gavrilenko <[email protected]>
  • Loading branch information
natgavrilenko and Natalia Gavrilenko committed Aug 9, 2024
1 parent 7ab9457 commit d7f7d09
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public Expression getDecoration(String id, Type type) {

private Expression getDecorationExpressions(String id, Type type) {
return switch (mapping.get(id)) {
// BuiltIn decorations according to the Vulkan API
case "SubgroupLocalInvocationId" -> makeScalar(id, type, tid % grid.sgSize());
case "LocalInvocationId" -> makeArray(id, type, tid % grid.wgSize(), 0, 0);
case "LocalInvocationIndex" -> makeScalar(id, type, tid % grid.wgSize()); // scalar of LocalInvocationId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,18 @@ public Expression visitRegister(Register register) {
public Expression visitMemoryObject(MemoryObject memObj) {
String storageClass = pointerMapping.get(memObj).getScopeId();
return switch (storageClass) {
// Device-level memory (keep the same instance)
case Tag.Spirv.SC_UNIFORM_CONSTANT,
Tag.Spirv.SC_UNIFORM,
Tag.Spirv.SC_OUTPUT,
Tag.Spirv.SC_PUSH_CONSTANT,
Tag.Spirv.SC_STORAGE_BUFFER,
Tag.Spirv.SC_PHYS_STORAGE_BUFFER -> memObj;
// Private memory (copy for each new thread)
case Tag.Spirv.SC_PRIVATE,
Tag.Spirv.SC_FUNCTION,
Tag.Spirv.SC_INPUT -> applyMapping(memObj, 0);
// Workgroup-level memory (copy for each new workgroup)
case Tag.Spirv.SC_WORKGROUP -> applyMapping(memObj, 2);
default -> throw new UnsupportedOperationException(
"Unsupported storage class " + storageClass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.dat3m.dartagnan.expression.Type;
import com.dat3m.dartagnan.expression.base.LeafExpressionBase;

// TODO: Should be replaced with a Pointer class
public class Location extends LeafExpressionBase<Type> {

private final String name;
Expand Down

0 comments on commit d7f7d09

Please sign in to comment.