[Beignet] [PATCH] only check beignet special test cases on beignet

Yang, Rong R rong.r.yang at intel.com
Wed Aug 3 08:52:45 UTC 2016


All utest patches pushed, thanks.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Guo Yejun
> Sent: Wednesday, August 3, 2016 3:13
> To: beignet at lists.freedesktop.org
> Cc: Guo, Yejun <yejun.guo at intel.com>
> Subject: [Beignet] [PATCH] 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 <yejun.guo at intel.com>
> ---
>  utests/get_cl_info.cpp | 85 ++++++++++++++++++++++++++++--------------
> --------
>  1 file changed, 47 insertions(+), 38 deletions(-)
> 
> diff --git a/utests/get_cl_info.cpp b/utests/get_cl_info.cpp index
> 801d0c2..42edf1a 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);
> --
> 1.9.1
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list