Fix invalid const atomic builtin accesses.
Clang fixed a signature issue with builtin atomic functions accidentally
allowing const-qualified arguments. This change removes the invalid
const qualifiers from those calls. The error message looks like:
"address argument to atomic builtin cannot be const-qualified"
Bug: http://b/110779387
Test: Builds with new compiler.
Change-Id: Ib0cb00f17ce8383134a89d4dcce5dcf0e5b738bf
diff --git a/cpu_ref/rsCpuCore.cpp b/cpu_ref/rsCpuCore.cpp
index 14b1e66..7039cec 100644
--- a/cpu_ref/rsCpuCore.cpp
+++ b/cpu_ref/rsCpuCore.cpp
@@ -506,7 +506,7 @@
return *outBuf;
}
-static void reduce_get_accumulator(uint8_t *&accumPtr, const MTLaunchStructReduce *mtls,
+static void reduce_get_accumulator(uint8_t *&accumPtr, MTLaunchStructReduce *mtls,
const char *walkerName, uint32_t threadIdx) {
rsAssert(!accumPtr);
@@ -531,7 +531,7 @@
}
static void walk_1d_reduce(void *usr, uint32_t idx) {
- const MTLaunchStructReduce *mtls = (const MTLaunchStructReduce *)usr;
+ MTLaunchStructReduce *mtls = (MTLaunchStructReduce *)usr;
RsExpandKernelDriverInfo redp = mtls->redp;
// find accumulator
@@ -570,7 +570,7 @@
}
static void walk_2d_reduce(void *usr, uint32_t idx) {
- const MTLaunchStructReduce *mtls = (const MTLaunchStructReduce *)usr;
+ MTLaunchStructReduce *mtls = (MTLaunchStructReduce *)usr;
RsExpandKernelDriverInfo redp = mtls->redp;
// find accumulator
@@ -609,7 +609,7 @@
}
static void walk_3d_reduce(void *usr, uint32_t idx) {
- const MTLaunchStructReduce *mtls = (const MTLaunchStructReduce *)usr;
+ MTLaunchStructReduce *mtls = (MTLaunchStructReduce *)usr;
RsExpandKernelDriverInfo redp = mtls->redp;
// find accumulator
diff --git a/cpu_ref/rsCpuIntrinsicBLAS.cpp b/cpu_ref/rsCpuIntrinsicBLAS.cpp
index d60a3b9..849693d 100644
--- a/cpu_ref/rsCpuIntrinsicBLAS.cpp
+++ b/cpu_ref/rsCpuIntrinsicBLAS.cpp
@@ -142,7 +142,7 @@
// Generic GEMM callback routine.
template <typename T_data, typename T_param, typename Func>
static void walk_tiled_gemm(Func blasFunc, T_param alpha, T_param beta, int vecSize,
- RsBlasCall* call, const MTLaunchStructForEachBlas *mtls) {
+ RsBlasCall* call, MTLaunchStructForEachBlas *mtls) {
// setup BLAS enum args
enum CBLAS_TRANSPOSE TransA = (enum CBLAS_TRANSPOSE)call->transA;
enum CBLAS_TRANSPOSE TransB = (enum CBLAS_TRANSPOSE)call->transB;
@@ -190,7 +190,7 @@
// SGEMM callback
static void walk_2d_sgemm(void *usr, uint32_t idx) {
- const MTLaunchStructForEachBlas *mtls = (const MTLaunchStructForEachBlas *)usr;
+ MTLaunchStructForEachBlas *mtls = (MTLaunchStructForEachBlas *)usr;
RsBlasCall* call = (RsBlasCall*) mtls->sc;
float alpha = call->alpha.f;
@@ -201,7 +201,7 @@
// DGEMM callback
static void walk_2d_dgemm(void *usr, uint32_t idx) {
- const MTLaunchStructForEachBlas *mtls = (const MTLaunchStructForEachBlas *)usr;
+ MTLaunchStructForEachBlas *mtls = (MTLaunchStructForEachBlas *)usr;
RsBlasCall* call = (RsBlasCall*) mtls->sc;
double alpha = call->alpha.d;
@@ -212,7 +212,7 @@
// CGEMM callback
static void walk_2d_cgemm(void *usr, uint32_t idx) {
- const MTLaunchStructForEachBlas *mtls = (const MTLaunchStructForEachBlas *)usr;
+ MTLaunchStructForEachBlas *mtls = (MTLaunchStructForEachBlas *)usr;
RsBlasCall* call = (RsBlasCall*) mtls->sc;
void * alpha = (void *)&call->alpha.c;
@@ -223,7 +223,7 @@
// ZGEMM callback
static void walk_2d_zgemm(void *usr, uint32_t idx) {
- const MTLaunchStructForEachBlas *mtls = (const MTLaunchStructForEachBlas *)usr;
+ MTLaunchStructForEachBlas *mtls = (MTLaunchStructForEachBlas *)usr;
RsBlasCall* call = (RsBlasCall*) mtls->sc;
void * alpha = (void *)&call->alpha.z;