| 696 | } |
| 697 | |
| 698 | cl_int FFTBinaryLookup::retrieveDeviceAndDriverInfo() |
| 699 | { |
| 700 | char m_device_vendor[SIZE]; |
| 701 | char m_device_name[SIZE]; |
| 702 | char m_driver_version[SIZE]; |
| 703 | |
| 704 | cl_int err = clGetDeviceInfo(this->m_device, CL_DEVICE_VENDOR, sizeof(m_device_vendor), |
| 705 | &m_device_vendor, NULL); |
| 706 | if (err != CL_SUCCESS) |
| 707 | { |
| 708 | return err; |
| 709 | } |
| 710 | |
| 711 | err = clGetDeviceInfo(this->m_device, CL_DEVICE_NAME, sizeof(m_device_name), |
| 712 | &m_device_name, NULL); |
| 713 | if (err != CL_SUCCESS) |
| 714 | { |
| 715 | return err; |
| 716 | } |
| 717 | |
| 718 | err = clGetDeviceInfo(this->m_device, CL_DRIVER_VERSION, sizeof(m_driver_version), |
| 719 | &m_driver_version, NULL); |
| 720 | if (err != CL_SUCCESS) |
| 721 | { |
| 722 | return err; |
| 723 | } |
| 724 | |
| 725 | #if CAPS_DEBUG |
| 726 | fprintf(stderr, "device vendor = %s\n", this->m_device_vendor); |
| 727 | fprintf(stderr, "device name = %s\n", this->m_device_name); |
| 728 | fprintf(stderr, "driver version = %s\n", this->m_driver_version); |
| 729 | #endif |
| 730 | |
| 731 | try |
| 732 | { |
| 733 | const std::string & root = (std::string(cache_path) + m_device_vendor + sep()); |
| 734 | do_mkdir(root.c_str()); |
| 735 | |
| 736 | const std::string & root2 = (root + m_device_name + sep()); |
| 737 | do_mkdir(root2.c_str()); |
| 738 | |
| 739 | const std::string & root3 = (root2 + m_driver_version + sep()); |
| 740 | do_mkdir(root3.c_str()); |
| 741 | |
| 742 | const std::string & root4 = (root3 + this->m_cache_entry_name + sep()); |
| 743 | do_mkdir(root4.c_str()); |
| 744 | |
| 745 | this->m_path = root4; |
| 746 | |
| 747 | return CL_SUCCESS; |
| 748 | } |
| 749 | catch (std::string & e) |
| 750 | { |
| 751 | fprintf(stderr, "%s\n", e.c_str()); |
| 752 | cache_enabled = false; |
| 753 | this->m_cache_enabled = false; |
| 754 | |
| 755 | return CL_INVALID_VALUE; |
no test coverage detected