Files
rocm-systems/runtime/hsa-runtime/image/blit_src/create_hsaco_ascii_file.sh
T
Sean Keely 7e3db20826 Move Images code to hsa-runtime folder
Change-Id: I53c1845d985ac3e9708d952865009c0021f3bb4f
2020-04-30 19:35:57 -05:00

33 regels
831 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
//==============================================================================
EOF
for file in ocl_blit_object*
do
xxd -i $file
echo -e '\n'
done
} > "$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"