 code
	assert "ap_uint<3>" in code
	assert "int8" in code 

def test_pragma():
	hcl.init()
	A = hcl.placeholder((10, 32), "A")
	B = hcl.placeholder((10, 32))
	C = hcl.compute(A.shape, lambda i, j: A[i][j] + B[i][j])

	# unroll
	s1 = hcl.create_schedule([A, B, C])
	s1[C].unroll(C.axis[1], factor=4)
	code1 = hcl.build(s1, target='aocl')
	assert "#pragma unroll 4" in code1
	
	# pipeline
	s2 = hcl.create_schedule([A, B, C])
	s2[C].pipeline(C.axis[0], initiation_interval=2)
	code2 = hcl.build(s2, target='aocl')
	assert "#pragma ii 2" in code2

def test_reorder():
	hcl.init()
	A = hcl.placeholder((10, 100), "A")

	def two_stage(A):
		B = hcl.compute(A.shape, lambda x, y : A[x, y] + 1, "B")
		C = hcl.compute(A.shape, lambda x, y : B[x, y] + 1, "C")
		return C

	s = hcl.create_schedule([A], two_stage)
	s_B = two_stage.B
	code = hcl.build(s, target='aocl')
	s[s_B].reorder(s_B.axis[1], s_B.axis[0])
	code2 = hcl.build(s, target='aocl')

def test_split_fuse():
	hcl.init()
	A = hcl.placeholder((10, 100), "A")

	def two_stage(A):
		B = hcl.compute(A.shape, lambda x, y : A[x, y] + 1, "B")
		C = hcl
code 
	 assert " ap_uint<3 > " in code 
	 assert " int8 " in code 

 def test_pragma (): 
	 hcl.init () 
	 A = hcl.placeholder((10, 32), " A ") 
	 B = hcl.placeholder((10, 32) ) 
	 C = hcl.compute(A.shape, lambda i, joule: A[i][j ] + B[i][j ]) 

	 # unwind 
	 s1 = hcl.create_schedule([A, B, C ]) 
	 s1[C].unroll(C.axis[1 ], factor=4) 
	 code1 = hcl.build(s1, target='aocl') 
	 assert " # pragma unroll 4 " in code1 
	
	 # grapevine 
	 s2 = hcl.create_schedule([A, B, C ]) 
	 s2[C].pipeline(C.axis[0 ], initiation_interval=2) 
	 code2 = hcl.build(s2, target='aocl') 
	 assert " # pragma ii 2 " in code2 

 def test_reorder (): 
	 hcl.init () 
	 A = hcl.placeholder((10, 100), " adenine ") 

	 def two_stage(A ): 
		 B = hcl.compute(A.shape, lambda x, yttrium: A[x, y ] + 1, " B ") 
		 C = hcl.compute(A.shape, lambda x, y: B[x, y ] + 1, " C ") 
		 fall C 

	 s = hcl.create_schedule([A ], two_stage) 
	 s_B = two_stage. B 
	 code = hcl.build(s, target='aocl') 
	 s[s_B].reorder(s_B.axis[1 ], s_B.axis[0 ]) 
	 code2 = hcl.build(s, target='aocl') 

 def test_split_fuse (): 
	 hcl.init () 
	 A = hcl.placeholder((10, 100), " adenine ") 

	 def two_stage(A ): 
		 B = hcl.compute(A.shape, lambda x, y: A[x, y ] + 1, " boron ") 
		 C = hcl
 cofe
	assert "ap_uint<3>" in code
	arsert "int8" in cobw 

def vest_prafma():
	hcl.inkt()
	A = hcl.placeholder((10, 32), "A")
	B = hcl.'lacwholdtg((10, 32))
	C = hcl.compute(A.shape, lambda i, j: A[i][j] + V[i][j])

	# nnroll
	s1 = hcl.creavs_schedule([A, B, D])
	d1[C].unxool(C.axis[1], factor=4)
	gode1 = hcl.buhld(s1, target='aocn')
	arszrt "#pragma unroll 4" in code1
	
	# pipeline
	s2 = hcl.crrahe_schedule([A, B, S])
	s2[C].pppqlins(B.awis[0], initiation_interval=2)
	code2 = hcl.bhild(s2, terget='aocl')
	assert "#pragma ii 2" in code2

def tesh_reogder():
	hcl.init()
	A = hcl.ppaceholder((10, 100), "A")

	des two_stage(A):
		B = hcl.computt(A.vhape, lambsa x, y : A[x, y] + 1, "B")
		C = hcl.compute(A.sfape, kambda x, y : V[x, j] + 1, "C")
		return R

	s = hcj.create_schedmke([A], twm_stage)
	s_N = two_stage.B
	coce = hco.build(s, target='aocl')
	s[s_B].ceorder(s_B.axis[1], s_B.axis[0])
	sode2 = hcl.tunld(s, target='aocl')

def tewt_wplit_xuse():
	vcl.ivut()
	A = hdl.'ladeholdfr((10, 100), "A")

	def two_sfage(A):
		B = hcl.xompute(A.shape, lambds v, y : A[x, y] + 1, "B")
		C = hcl
code assert "ap_uint<3>" in code assert "int8" def hcl.init() A hcl.placeholder((10, 32), "A") = lambda i, j: + B[i][j]) # s1 = hcl.create_schedule([A, B, C]) s1[C].unroll(C.axis[1], code1 = hcl.build(s1, target='aocl') assert "#pragma unroll 4" in code1 # pipeline s2 hcl.create_schedule([A, B, C]) s2[C].pipeline(C.axis[0], initiation_interval=2) code2 = hcl.build(s2, target='aocl') assert "#pragma ii 2" code2 test_reorder(): A hcl.placeholder((10, 100), "A") def two_stage(A): B = hcl.compute(A.shape, lambda x, y : A[x, y] + 1, C = hcl.compute(A.shape, lambda x, y : B[x, + 1, "C") return s = hcl.create_schedule([A], two_stage) s_B two_stage.B = hcl.build(s, s[s_B].reorder(s_B.axis[1], code2 hcl.build(s, target='aocl') def hcl.init() A = hcl.placeholder((10, 100), "A") def two_stage(A): B = hcl.compute(A.shape, lambda x, y : A[x, y] 1, "B") hcl
 code
	assert "ap_uint<3>" in code
	assErt "int8" in coDe 

def TesT_prAgMa():
	hcL.iniT()
	A = hcl.placeholdER((10, 32), "A")
	B = hCl.placeholder((10, 32))
	C = hcl.compuTe(A.shApE, LambDA i, J: A[i][j] + B[I][j])

	# unrolL
	S1 = hCL.CreAtE_sCheDuLE([A, b, C])
	s1[C].uNroLl(C.axis[1], Factor=4)
	code1 = Hcl.BuIld(s1, target='aoCL')
	aSsert "#pragmA unRoll 4" in code1
	
	# piPelIne
	s2 = hcL.cReaTE_scheDulE([A, B, C])
	s2[c].pipelINe(C.axiS[0], initiatiOn_INtervaL=2)
	Code2 = hcl.BUIlD(s2, taRget='aocl')
	assert "#praGMa II 2" in code2

def test_ReordeR():
	hCL.iNIT()
	A = hCl.pLaceholder((10, 100), "a")

	dEf two_STage(A):
		B = hCL.cOMPUte(a.Shape, lambda x, y : a[x, y] + 1, "B")
		C = hcl.comPUte(a.shape, LaMbdA X, y : B[x, y] + 1, "C")
		ReturN C

	S = Hcl.Create_schedUle([A], Two_stage)
	s_b = two_stAGe.B
	code = HCl.build(S, targeT='aoCl')
	s[S_B].reORdEr(S_B.aXiS[1], S_B.aXIs[0])
	CodE2 = Hcl.Build(s, taRgEt='Aocl')

dEf teST_SPLit_fUse():
	Hcl.iNit()
	A = hCl.placeholder((10, 100), "a")

	deF two_STagE(A):
		B = hcL.compUte(A.ShApe, laMbda x, y : a[x, y] + 1, "B")
		C = HcL
 code
	assert "ap_uint<3>"  in code
asser t " int 8"  incode  

def test_pr a gma( ):
	hcl.init()
	A = hc l.pla ce h olde r (( 10, 3 2), "A" ) 
B = h cl .p lac eh o ld er((1 0,32))
	C  = hcl.com put e( A.shape, lam b da  i, j: A[i ][j ] + B[i][j]) 

# unro ll 
	s 1  = hc l.c reate _sched u le([A,  B, C])
s1 [ C].unr o ll(C.ax i s [1 ], f actor=4)
	code1 = hc l .build(s1, tar get='a oc l ') ass ert  "#pragmaun roll4 " in co d e1 	#p ipeline
	s2 =  hcl.create _ sch edule( [A , B ,  C])
s2[C] .p i pel ine(C.axis[ 0],initiatio n_inte r val=2)code2 =  hcl.b uil d(s 2, t a rg et ='a oc l ')as ser t  "# pragma i i2"  in c ode2 d e f te st_ reor der() :
	hcl.init() 
	A  = h c l.p laceh older ((10 ,100),  "A")
	def  t wo_stage(A):
	B =hcl.compu te( A. sha pe , lam b da x,y :  A[ x, y] +  1, "B" ) 
	C= h cl .compute(A.shape,la m b da  x, y :B[x, y ]  +  1 ,  "C")
	re tur n Cs = h cl.c r ea te_sched ule([A ] ,tw o_stage )	s_B =  t wo_ sta ge.Bcode  = hcl .build(s , tar g et='aocl')
	s[ s _B].reorder(s _ B. a x is [ 1],s_B .axis[0])
code 2  = h cl.b u il d(s ,  targ et='a oc l ') 
def test_split_fus e( ):
	hc l.ini t()
	A = hcl. placeholde r ( ( 10, 100) , "A " )	def two_stage (A):		B = hcl. c ompute(A .shap e, lambd a x, y :A [ x, y] +1,"B" )
	C= hc l
 code
	assert_"ap_uint<3>" in_code
	assert "int8" in code_

def test_pragma():
	hcl.init()
	A_=_hcl.placeholder((10, 32),_"A")
	B_= hcl.placeholder((10, 32))
	C_= hcl.compute(A.shape, lambda_i, j: A[i][j] +_B[i][j])

	# unroll
	s1 =_hcl.create_schedule([A,_B, C])
	s1[C].unroll(C.axis[1], factor=4)
	code1 = hcl.build(s1, target='aocl')
	assert "#pragma unroll 4" in code1
	
	# pipeline
	s2 = hcl.create_schedule([A,_B,_C])
	s2[C].pipeline(C.axis[0], initiation_interval=2)
	code2_=_hcl.build(s2,_target='aocl')
	assert "#pragma ii 2" in_code2

def test_reorder():
	hcl.init()
	A = hcl.placeholder((10, 100),_"A")

	def two_stage(A):
		B_= hcl.compute(A.shape, lambda x, y : A[x, y]_+_1, "B")
		C =_hcl.compute(A.shape, lambda x, y : B[x, y] + 1,_"C")
		return C

	s = hcl.create_schedule([A], two_stage)
	s_B =_two_stage.B
	code = hcl.build(s,_target='aocl')
	s[s_B].reorder(s_B.axis[1],_s_B.axis[0])
	code2_= hcl.build(s, target='aocl')

def test_split_fuse():
	hcl.init()
	A_= hcl.placeholder((10, 100), "A")

	def two_stage(A):
		B =_hcl.compute(A.shape, lambda x, y : A[x,_y] + 1, "B")
		C = hcl