-
Notifications
You must be signed in to change notification settings - Fork 0
/
MemoryAccessShift.java
72 lines (66 loc) · 2.78 KB
/
MemoryAccessShift.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package com.destranix.glslang;
public enum MemoryAccessShift {
MemoryAccessVolatileShift(Main.MEMORY_ACCESS_VOLATILE_SHIFT),
MemoryAccessAlignedShift(Main.MEMORY_ACCESS_ALIGNED_SHIFT),
MemoryAccessNontemporalShift(Main.MEMORY_ACCESS_NONTEMPORAL_SHIFT),
MemoryAccessMakePointerAvailableShift(Main.MEMORY_ACCESS_MAKE_POINTER_AVAILABLE_SHIFT),
MemoryAccessMakePointerAvailableKHRShift(Main.MEMORY_ACCESS_MAKE_POINTER_AVAILABLE_KHR_SHIFT),
MemoryAccessMakePointerVisibleShift(Main.MEMORY_ACCESS_MAKE_POINTER_VISIBLE_SHIFT),
MemoryAccessMakePointerVisibleKHRShift(Main.MEMORY_ACCESS_MAKE_POINTER_VISIBLE_KHR_SHIFT),
MemoryAccessNonPrivatePointerShift(Main.MEMORY_ACCESS_NON_PRIVATE_POINTER_SHIFT),
MemoryAccessNonPrivatePointerKHRShift(Main.MEMORY_ACCESS_NON_PRIVATE_POINTER_KHR_SHIFT),
MemoryAccessMax(Main.MEMORY_ACCESS_MAX);
private final int value;
private MemoryAccessShift(int value) {
this.value = value;
}
public int getConstant() {
return this.value;
}
public static MemoryAccessShift valueByStr(String str) {
switch (str) {
case "MemoryAccessVolatileShift":
return MemoryAccessVolatileShift;
case "MemoryAccessAlignedShift":
return MemoryAccessAlignedShift;
case "MemoryAccessNontemporalShift":
return MemoryAccessNontemporalShift;
case "MemoryAccessMakePointerAvailableShift":
return MemoryAccessMakePointerAvailableShift;
case "MemoryAccessMakePointerAvailableKHRShift":
return MemoryAccessMakePointerAvailableKHRShift;
case "MemoryAccessMakePointerVisibleShift":
return MemoryAccessMakePointerVisibleShift;
case "MemoryAccessMakePointerVisibleKHRShift":
return MemoryAccessMakePointerVisibleKHRShift;
case "MemoryAccessNonPrivatePointerShift":
return MemoryAccessNonPrivatePointerShift;
case "MemoryAccessNonPrivatePointerKHRShift":
return MemoryAccessNonPrivatePointerKHRShift;
case "MemoryAccessMax":
return MemoryAccessMax;
default:
throw new IllegalArgumentException("Cannot translate string into enum value!");
}
}
public static MemoryAccessShift valueByConstant(int constant) {
switch (constant) {
case Main.MEMORY_ACCESS_VOLATILE_SHIFT:
return MemoryAccessVolatileShift;
case Main.MEMORY_ACCESS_ALIGNED_SHIFT:
return MemoryAccessAlignedShift;
case Main.MEMORY_ACCESS_NONTEMPORAL_SHIFT:
return MemoryAccessNontemporalShift;
case Main.MEMORY_ACCESS_MAKE_POINTER_AVAILABLE_SHIFT:
return MemoryAccessMakePointerAvailableShift;
case Main.MEMORY_ACCESS_MAKE_POINTER_VISIBLE_SHIFT:
return MemoryAccessMakePointerVisibleShift;
case Main.MEMORY_ACCESS_NON_PRIVATE_POINTER_SHIFT:
return MemoryAccessNonPrivatePointerShift;
case Main.MEMORY_ACCESS_MAX:
return MemoryAccessMax;
default:
throw new IllegalArgumentException("Cannot translate constant into enum value!");
}
}
}