MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / isSupLen

Function isSupLen

src/backend/opencl/fft.cpp:46–65  ·  view source on GitHub ↗

(currently) true is in clFFT if length is a power of 2,3,5

Source from the content-addressed store, hash-verified

44
45//(currently) true is in clFFT if length is a power of 2,3,5
46inline bool isSupLen(dim_t length) {
47 while (length > 1) {
48 if (length % 2 == 0) {
49 length /= 2;
50 } else if (length % 3 == 0) {
51 length /= 3;
52 } else if (length % 5 == 0) {
53 length /= 5;
54 } else if (length % 7 == 0) {
55 length /= 7;
56 } else if (length % 11 == 0) {
57 length /= 11;
58 } else if (length % 13 == 0) {
59 length /= 13;
60 } else {
61 return false;
62 }
63 }
64 return true;
65}
66
67void verifySupported(const int rank, const dim4 &dims) {
68 for (int i = 0; i < rank; i++) { ARG_ASSERT(1, isSupLen(dims[i])); }

Callers 1

verifySupportedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected