Files
rocm-systems/runtime/hsa-runtime/image/blit_src/create_hsaco_ascii_file.sh
T
Ramesh Errabolu 0ca0691ca7 Build ROCr core and image libraries as one shared object
Change-Id: I3a16c1227e7db2e386ab33886965596fa0fb0c87
2020-06-19 22:33:36 -04:00

42 wiersze
924 B
Bash
Executable File

#!/bin/bash -e
opencl_blit_file="$1"
if ! command -v xxd >/dev/null
then
echo "xxd not found!"
exit 1
fi
# Create the file in a temporary location and then move it in atomically
rm -rf "$opencl_blit_file.tmp"
{
cat <<EOF
//==============================================================================
// This file is automatically generated during build process, don't modify it
//==============================================================================
namespace rocr {
namespace image {
EOF
for file in ocl_blit_object*
do
xxd -i $file
echo -e '\n'
done
cat <<EOF
} // namespace image
} // namespace rocr
EOF
} > "$opencl_blit_file.tmp"
# Move the file atomically into place, so make doesn't get half a file
# but only if it has changed. cmp -s is happy for one file not to exist
cmp -s "$opencl_blit_file.tmp" "$opencl_blit_file" ||
mv -f "$opencl_blit_file.tmp" "$opencl_blit_file"