Skip to content

Commit 706b101

Browse files
jhananitigcbot
authored andcommitted
Adding Android feature
Adding Android feature.
1 parent a987d8b commit 706b101

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

IGC/AdaptorOCL/ocl_igc_interface/impl/fcl_ocl_translation_ctx_impl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ SPDX-License-Identifier: MIT
4040
#include <iostream>
4141
#include <string>
4242
#include <vector>
43+
#if defined(__ANDROID__)
44+
#include <sstream>
45+
#endif
4346

4447
#if defined( _DEBUG ) || defined( _INTERNAL )
4548
#include <numeric>

IGC/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,6 +1711,11 @@ list(APPEND _targetLinkLineCommon zebinlib)
17111711
"${CMAKE_DL_LIBS}"
17121712
)
17131713
endif()
1714+
# Android binary needs to link static libstdc++ and liblog
1715+
if(ANDROID)
1716+
find_package(Threads REQUIRED)
1717+
target_link_libraries("${IGC_BUILD__PROJ${_libBuildSuffix}}" PRIVATE Threads::Threads -static-libstdc++ -llog)
1718+
endif()
17141719
# Link line for shared / dynamic library requires only library project (all static libs are linked inside).
17151720
set_property(TARGET "${IGC_BUILD__PROJ${_libBuildSuffix}}" PROPERTY LINK_INTERFACE_LIBRARIES "")
17161721
set("IGC_BUILD__LINK_LINE${_libBuildSuffix}"

IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ void OptimizeIR(CodeGenContext* const pContext)
15331533
});
15341534

15351535
mpm.add(new TargetTransformInfoWrapperPass(GenTTgetIIRAnalysis));
1536-
#if defined(_DEBUG) && !defined(ANDROID)
1536+
#if defined(_DEBUG) && !defined(__ANDROID__)
15371537
// IGC IR Verification pass checks that we get a correct IR after the Unification.
15381538
mpm.add(new VerificationPass());
15391539
#endif

visa/BinaryEncodingCNL.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ typedef uint64_t QWORD;
2828
#define BITFIELD_RANGE(startbit, endbit) ((endbit)-(startbit)+1)
2929
#define BITFIELD_BIT(bit) 1
3030

31+
#if !defined(__ANDROID__)
3132
#define __CONCAT(x,y) x ## y
33+
#endif
3234
#define __UNIQUENAME(a1, a2) __CONCAT(a1, a2)
3335
#define UNIQUENAME(__text) __UNIQUENAME(__text, __COUNTER__)
3436
#define STATIC_ASSERT(e) typedef char UNIQUENAME(STATIC_ASSERT_)[(e)?1:-1]

visa/iga/IGALibrary/IR/DUAnalysis.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,8 +1033,16 @@ struct DepAnalysisComputer
10331033

10341034
static bool updateLiveDefs(LivePaths &to, const LivePaths &from) {
10351035
bool changed = from != to;
1036-
if (changed)
1037-
to = from;
1036+
if (changed) {
1037+
#if defined(__ANDROID__)
1038+
to.clear();
1039+
for (auto iter : from) {
1040+
to.insert(iter);
1041+
}
1042+
#else
1043+
to = from;
1044+
#endif
1045+
}
10381046
return changed;
10391047
}
10401048

0 commit comments

Comments
 (0)