Add source of prevPower function

This commit is contained in:
Max Lübke 2023-10-05 08:22:08 +02:00
parent 505d0cb9da
commit c9c0daa098

View File

@ -132,7 +132,11 @@ auto matrixMultTransposeSYCL(sycl::queue &q, const Matrix<data_type> &matA,
return matRes.chksum();
}
/* Obtains the previous power of two from the given integer.
/*
* Obtained from
* https://github.com/codeplaysoftware/computecpp-sdk/blob/master/samples/matrix-multiply.cpp
*
* Obtains the previous power of two from the given integer.
* It works by masking out all ones after the first one bit,
* then leaves the first one bit intact, effectively
* yielding the first power of two < x. */