Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Include OpenCL version information into --list=build-info

  • Loading branch information...
commit a29f3d4cab05836264d7a5d8a0ae2a9c2d465f17 1 parent 73fc487
@ukasz ukasz authored committed
View
1  .gitignore
@@ -24,6 +24,7 @@ run/mozilla2john
run/office2john
run/kernels/
run/pfx2john
+run/putty2john
run/pwsafe2john
run/racf2john
run/rar2john
View
25 src/common-opencl.c
@@ -873,6 +873,31 @@ int get_device_version(int dev_id)
return DEV_UNKNOWN;
}
+char *get_opencl_header_version()
+{
+ static char *opencl_versions[] = {
+ "1.0","1.1","1.2","1.3","1.4","1.5",
+ };
+ int version = -1;
+ #ifdef CL_VERSION_1_5
+ version = 5;
+ #elif CL_VERSION_1_4
+ version = 4;
+ #elif CL_VERSION_1_3
+ version = 3;
+ #elif CL_VERSION_1_2
+ version = 2;
+ #elif CL_VERSION_1_1
+ version = 1;
+ #elif CL_VERSION_1_0
+ version = 0;
+ #endif
+ if (version == -1 || version > 5 ) {
+ return "Unknown";
+ }
+ return opencl_versions[version];
+}
+
char *get_error_name(cl_int cl_error)
{
static char *err_small[] = {
View
4 src/common-opencl.h
@@ -80,8 +80,12 @@ int get_platform_vendor_id(int platform_id);
int get_device_version(int dev_id);
int get_byte_addressable(int dev_id);
+/* Returns error name based on error codes list defined in cl.h */
char *get_error_name(cl_int cl_error);
+/* Returns OpenCL version based on macro CL_VERSION_X_Y definded in cl.h */
+char *get_opencl_header_version();
+
void handle_clerror(cl_int cl_error, const char *message, const char *file, int line);
void advance_cursor();
View
4 src/listconf.c
@@ -134,6 +134,9 @@ static void listconf_list_build_info(void)
#ifdef __clang_version__
printf("clang version: %s\n", __clang_version__);
#endif
+#ifdef HAVE_OPENCL
+ printf("OpenCL library version: %s\n",get_opencl_header_version());
+#endif
#ifdef OPENSSL_VERSION_NUMBER
// The man page suggests the type of OPENSSL_VERSION_NUMBER is long,
// gcc insists it is int.
@@ -142,7 +145,6 @@ static void listconf_list_build_info(void)
printf("\t(loaded: %lx)", (unsigned long)SSLeay());
printf("\n");
#endif
-
#ifdef __GNU_MP_VERSION
// print GMP version info if HAVE_GMP has been set in Makefile
printf("GMP library version: %d.%d.%d",
Please sign in to comment.
Something went wrong with that request. Please try again.