Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Driver/ToolChains/HIP.cpp
Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | void AMDGCN::Linker::constructGenerateObjFileFromHIPFatBinary( | ||||
llvm::raw_string_ostream ObjStream(ObjBuffer); | llvm::raw_string_ostream ObjStream(ObjBuffer); | ||||
// Add MC directives to embed target binaries. We ensure that each | // Add MC directives to embed target binaries. We ensure that each | ||||
// section and image is 16-byte aligned. This is not mandatory, but | // section and image is 16-byte aligned. This is not mandatory, but | ||||
// increases the likelihood of data to be aligned with a cache block | // increases the likelihood of data to be aligned with a cache block | ||||
// in several main host machines. | // in several main host machines. | ||||
ObjStream << "# HIP Object Generator\n"; | ObjStream << "# HIP Object Generator\n"; | ||||
ObjStream << "# *** Automatically generated by Clang ***\n"; | ObjStream << "# *** Automatically generated by Clang ***\n"; | ||||
ObjStream << " .protected __hip_fatbin\n"; | |||||
ObjStream << " .type __hip_fatbin,@object\n"; | ObjStream << " .type __hip_fatbin,@object\n"; | ||||
ObjStream << " .section .hip_fatbin,\"a\",@progbits\n"; | ObjStream << " .section .hip_fatbin,\"a\",@progbits\n"; | ||||
ObjStream << " .globl __hip_fatbin\n"; | ObjStream << " .globl __hip_fatbin\n"; | ||||
ObjStream << " .p2align " << llvm::Log2(llvm::Align(HIPCodeObjectAlign)) | ObjStream << " .p2align " << llvm::Log2(llvm::Align(HIPCodeObjectAlign)) | ||||
<< "\n"; | << "\n"; | ||||
ObjStream << "__hip_fatbin:\n"; | ObjStream << "__hip_fatbin:\n"; | ||||
ObjStream << " .incbin \"" << BundleFile << "\"\n"; | ObjStream << " .incbin \"" << BundleFile << "\"\n"; | ||||
ObjStream.flush(); | ObjStream.flush(); | ||||
▲ Show 20 Lines • Show All 296 Lines • Show Last 20 Lines |