| 34 | void setFFTPlanCacheSize(size_t numPlans) {} |
| 35 | |
| 36 | std::string genPlanHashStr(int rank, ::oneapi::mkl::dft::precision precision, |
| 37 | ::oneapi::mkl::dft::domain domain, |
| 38 | const bool isInPlace, const dim_t *n, |
| 39 | std::int64_t *istrides, int ibatch, |
| 40 | std::int64_t *ostrides, int obatch, int nbatch) { |
| 41 | // create the key string |
| 42 | char key_str_temp[64]; |
| 43 | sprintf(key_str_temp, "%d:", rank); |
| 44 | |
| 45 | std::string key_string(key_str_temp); |
| 46 | |
| 47 | if (precision == ::oneapi::mkl::dft::precision::SINGLE) { |
| 48 | key_string.append("S:"); |
| 49 | } else if (precision == ::oneapi::mkl::dft::precision::DOUBLE) { |
| 50 | key_string.append("D:"); |
| 51 | } |
| 52 | if (domain == ::oneapi::mkl::dft::domain::REAL) { |
| 53 | key_string.append("R:"); |
| 54 | } else if (domain == ::oneapi::mkl::dft::domain::COMPLEX) { |
| 55 | key_string.append("C:"); |
| 56 | } |
| 57 | if (isInPlace) { |
| 58 | key_string.append("IIP:"); |
| 59 | } else { |
| 60 | key_string.append("OOP:"); |
| 61 | } |
| 62 | |
| 63 | for (int r = 0; r < rank; ++r) { |
| 64 | sprintf(key_str_temp, "%lld:", n[r]); |
| 65 | key_string.append(std::string(key_str_temp)); |
| 66 | } |
| 67 | |
| 68 | if (istrides != nullptr) { |
| 69 | for (int r = 0; r < rank + 1; ++r) { |
| 70 | sprintf(key_str_temp, "%ld:", istrides[r]); |
| 71 | key_string.append(std::string(key_str_temp)); |
| 72 | } |
| 73 | sprintf(key_str_temp, "%d:", ibatch); |
| 74 | key_string.append(std::string(key_str_temp)); |
| 75 | } |
| 76 | |
| 77 | if (ostrides != nullptr) { |
| 78 | for (int r = 0; r < rank + 1; ++r) { |
| 79 | sprintf(key_str_temp, "%ld:", ostrides[r]); |
| 80 | key_string.append(std::string(key_str_temp)); |
| 81 | } |
| 82 | sprintf(key_str_temp, "%d:", obatch); |
| 83 | key_string.append(std::string(key_str_temp)); |
| 84 | } |
| 85 | |
| 86 | sprintf(key_str_temp, "%d", nbatch); |
| 87 | key_string.append(std::string(key_str_temp)); |
| 88 | |
| 89 | return key_string; |
| 90 | } |
| 91 | |
| 92 | std::vector<std::int64_t> computeStrides(const int rank, const dim4 istrides, |
| 93 | const dim_t offset) { |