def test_OpenClBacktrackingHelper_ShouldProceed_loop3( backtracker: backtracking_model.OpenClBacktrackingHelper, ): assert backtracker.ShouldProceed( """kernel void A(global int* a) { for (int i = 0; i < 10; ++i) { int x = 10;""" )
def test_OpenClBacktrackingHelper_ShouldProceed_depth1( backtracker: backtracking_model.OpenClBacktrackingHelper, ): assert backtracker.ShouldProceed( """kernel void A(global int* a) { int b = 0;""" )
def test_OpenClBacktrackingHelper_ShouldProceed_depth2( backtracker: backtracking_model.OpenClBacktrackingHelper, ): assert backtracker.ShouldProceed( """kernel void A(global int* a) { int b = 0; if (get_global_id(0) < 10) { int c = 2;""" )
def test_OpenClBacktrackingHelper_TryToCloseProgram_loop1( backtracker: backtracking_model.OpenClBacktrackingHelper, ): assert ( backtracker.TryToCloseProgram( """kernel void A() { for (int a = 0;""" ) == """kernel void A() { for (int a = 0;;){}}""" )
def test_OpenClBacktrackingHelper_TryToCloseProgram_depth1( backtracker: backtracking_model.OpenClBacktrackingHelper, ): assert ( backtracker.TryToCloseProgram( """kernel void A() { int a = 0;""" ) == """kernel void A() { int a = 0;}""" )
def test_OpenClBacktrackingHelper_TryToCloseProgram_loop3( backtracker: backtracking_model.OpenClBacktrackingHelper, ): assert ( backtracker.TryToCloseProgram( """kernel void A() { for (int a = 0; a < 10; ++a) { { int x = 10;""" ) == """kernel void A() { for (int a = 0; a < 10; ++a) { { int x = 10;}}}""" )
def test_OpenClBacktrackingHelper_TryToCloseProgram_depth2( backtracker: backtracking_model.OpenClBacktrackingHelper, ): assert ( backtracker.TryToCloseProgram( """kernel void A() { int a = 0; if (get_global_id(0) < 10) { int a = 2;""" ) == """kernel void A() { int a = 0; if (get_global_id(0) < 10) { int a = 2;}}""" )
def test_OpenClBacktrackingHelper_ShouldCheckpoint_for_loop_3( backtracker: backtracking_model.OpenClBacktrackingHelper, ): assert backtracker.ShouldCheckpoint("for (int i = 0; i < 10; ++i) { int x;")
def test_OpenClBacktrackingHelper_ShouldCheckpoint_yes( backtracker: backtracking_model.OpenClBacktrackingHelper, ): assert backtracker.ShouldCheckpoint("int x = 5;")
def test_OpenClBacktrackingHelper_TryToCloseProgram_not_end_of_statement( backtracker: backtracking_model.OpenClBacktrackingHelper, ): assert not backtracker.TryToCloseProgram("kernel void A(".split())