From 44f130d75c030788ea6f60948f5dfc6e1632672d Mon Sep 17 00:00:00 2001 From: Guo Yejun Date: Wed, 3 Aug 2016 03:12:51 +0800 Subject: only check beignet special test cases on beignet with other implementation, do not check the result for the beignet special test cases Signed-off-by: Guo Yejun Reviewed-by: Yang Rong --- utests/get_cl_info.cpp | 85 ++++++++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 38 deletions(-) (limited to 'utests/get_cl_info.cpp') diff --git a/utests/get_cl_info.cpp b/utests/get_cl_info.cpp index 801d0c29..42edf1a6 100644 --- a/utests/get_cl_info.cpp +++ b/utests/get_cl_info.cpp @@ -413,13 +413,15 @@ void get_build_llvm_info(void) } } - //Test is successful if the backend created the file - if( (fp = fopen(llvm_file, "r")) == NULL) { - std::cout << "LLVM file creation.. FAILED"; - OCL_ASSERT(0); - } else { - fclose(fp); - std::cout << "LLVM file created.. SUCCESS"; + if (cl_check_beignet()) { + //Test is successful if the backend created the file + if( (fp = fopen(llvm_file, "r")) == NULL) { + std::cout << "LLVM file creation.. FAILED"; + OCL_ASSERT(0); + } else { + fclose(fp); + std::cout << "LLVM file created.. SUCCESS"; + } } } @@ -466,8 +468,8 @@ void compile_spir_binary(void) } } - //Test is successful if the backend created the file if (cl_check_beignet()) { + //Test is successful if the backend created the file if( (fp = fopen(spir_file, "r")) == NULL) { std::cout << "SPIR file creation.. FAILED"; OCL_ASSERT(0); @@ -517,13 +519,15 @@ void build_spir_binary(void) } } - //Test is successful if the backend created the file - if( (fp = fopen(spir_file, "r")) == NULL) { - std::cout << "SPIR file creation.. FAILED"; - OCL_ASSERT(0); - } else { - fclose(fp); - std::cout << "SPIR file created.. SUCCESS"; + if (cl_check_beignet()) { + //Test is successful if the backend created the file + if( (fp = fopen(spir_file, "r")) == NULL) { + std::cout << "SPIR file creation.. FAILED"; + OCL_ASSERT(0); + } else { + fclose(fp); + std::cout << "SPIR file created.. SUCCESS"; + } } } MAKE_UTEST_FROM_FUNCTION(build_spir_binary); @@ -567,13 +571,15 @@ void get_build_asm_info(void) } } - //Test is successful if the backend created the file - if( (fp = fopen(asm_file, "r")) == NULL) { - std::cout << "ASM file creation.. FAILED"; - OCL_ASSERT(0); - } else { - fclose(fp); - std::cout << "ASM file created.. SUCCESS"; + if (cl_check_beignet()) { + //Test is successful if the backend created the file + if( (fp = fopen(asm_file, "r")) == NULL) { + std::cout << "ASM file creation.. FAILED"; + OCL_ASSERT(0); + } else { + fclose(fp); + std::cout << "ASM file created.. SUCCESS"; + } } } @@ -614,15 +620,16 @@ void get_compile_llvm_info(void) } } - //Test is successful if the backend created the file - if( (fp = fopen(llvm_file, "r")) == NULL) { - std::cout << "LLVM file creation.. FAILED"; - OCL_ASSERT(0); - } else { - fclose(fp); - std::cout << "LLVM file created.. SUCCESS"; + if (cl_check_beignet()) { + //Test is successful if the backend created the file + if( (fp = fopen(llvm_file, "r")) == NULL) { + std::cout << "LLVM file creation.. FAILED"; + OCL_ASSERT(0); + } else { + fclose(fp); + std::cout << "LLVM file created.. SUCCESS"; + } } - } MAKE_UTEST_FROM_FUNCTION(get_compile_llvm_info); @@ -662,14 +669,16 @@ void get_link_asm_info(void) } } - //Test is successful if the backend created the file - if( (fp = fopen(asm_file, "r")) == NULL) { - std::cout << "ASM file creation.. FAILED"; - OCL_ASSERT(0); - } else { - fclose(fp); - std::cout << "ASM file created.. SUCCESS"; - } + if (cl_check_beignet()) { + //Test is successful if the backend created the file + if( (fp = fopen(asm_file, "r")) == NULL) { + std::cout << "ASM file creation.. FAILED"; + OCL_ASSERT(0); + } else { + fclose(fp); + std::cout << "ASM file created.. SUCCESS"; + } + } } MAKE_UTEST_FROM_FUNCTION(get_link_asm_info); -- cgit v1.2.1