2022-02-03 18:00:04 +00:00
|
|
|
// language: metal2.0
|
2021-05-03 04:18:35 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
#include <simd/simd.h>
|
|
|
|
|
|
|
|
|
2021-08-27 22:44:57 +00:00
|
|
|
void switch_default_break(
|
|
|
|
int i
|
|
|
|
) {
|
|
|
|
switch(i) {
|
|
|
|
default: {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void switch_case_break(
|
|
|
|
) {
|
|
|
|
switch(0) {
|
|
|
|
case 0: {
|
|
|
|
break;
|
|
|
|
}
|
2021-11-15 00:07:55 +00:00
|
|
|
default: {
|
|
|
|
break;
|
|
|
|
}
|
2021-08-27 22:44:57 +00:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
void loop_switch_continue(
|
|
|
|
int x
|
|
|
|
) {
|
|
|
|
while(true) {
|
|
|
|
switch(x) {
|
|
|
|
case 1: {
|
|
|
|
continue;
|
|
|
|
}
|
2021-11-15 00:07:55 +00:00
|
|
|
default: {
|
|
|
|
break;
|
|
|
|
}
|
2021-08-27 22:44:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-11-09 14:24:41 +00:00
|
|
|
struct main_Input {
|
2021-05-03 04:18:35 +00:00
|
|
|
};
|
2021-11-09 14:24:41 +00:00
|
|
|
kernel void main_(
|
2021-05-03 04:18:35 +00:00
|
|
|
metal::uint3 global_id [[thread_position_in_grid]]
|
|
|
|
) {
|
2021-08-23 02:30:22 +00:00
|
|
|
int pos;
|
2021-05-03 04:18:35 +00:00
|
|
|
metal::threadgroup_barrier(metal::mem_flags::mem_device);
|
|
|
|
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
2021-08-23 02:30:22 +00:00
|
|
|
switch(1) {
|
|
|
|
default: {
|
|
|
|
pos = 1;
|
2021-10-26 17:31:54 +00:00
|
|
|
break;
|
2021-08-23 02:30:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
int _e4 = pos;
|
|
|
|
switch(_e4) {
|
2021-08-31 21:48:28 +00:00
|
|
|
case 1: {
|
|
|
|
pos = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2: {
|
|
|
|
pos = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 3: {
|
|
|
|
pos = 2;
|
|
|
|
}
|
|
|
|
case 4: {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
pos = 3;
|
2021-10-26 17:31:54 +00:00
|
|
|
break;
|
2021-08-31 21:48:28 +00:00
|
|
|
}
|
|
|
|
}
|
2021-09-19 21:31:38 +00:00
|
|
|
switch(0u) {
|
|
|
|
case 0u: {
|
|
|
|
break;
|
|
|
|
}
|
2021-11-15 00:07:55 +00:00
|
|
|
default: {
|
|
|
|
break;
|
|
|
|
}
|
2021-09-19 21:31:38 +00:00
|
|
|
}
|
|
|
|
int _e10 = pos;
|
|
|
|
switch(_e10) {
|
2021-08-23 02:30:22 +00:00
|
|
|
case 1: {
|
|
|
|
pos = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2: {
|
|
|
|
pos = 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 3: {
|
|
|
|
pos = 2;
|
|
|
|
}
|
|
|
|
case 4: {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
pos = 3;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2021-05-03 04:18:35 +00:00
|
|
|
}
|