为GCC编译器的HSA分支制作样本

时间:2015-05-10 04:44:42

标签: gcc openmp amd-processor

我刚刚根据associated wiki构建并安装了gcc的hsa分支。一切都相当顺利,直到我开始制作样本,vectorCopy和matrixMultiply。这是我在运行make命令时为matrixMultiply得到的错误输出(再次,遵循维基的建议):

/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_region_get_info'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_init'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_signal_create'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_agent_iterate_regions'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_ext_program_create'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_signal_store_relaxed'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_executable_get_symbol'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_ext_program_add_module'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_signal_wait_acquire'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_ext_program_destroy'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_memory_allocate'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_status_string'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_iterate_agents'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_ext_program_finalize'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_executable_create'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_agent_get_info'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_queue_create'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_executable_freeze'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_queue_add_write_index_relaxed'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_executable_symbol_get_info'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_executable_load_code_object'

我使用Lubuntu 15.04和标准内核(3.19)。我使用的是稍微旧的驱动程序和运行时组件,对应于HSA 1.0 Provisional而不是1.0 Final,因为Okra(HSA-OpenMP-GCC需要)还不是最新的,不能与最新的驱动程序一起使用和固件。我有“健全性检查”运行时和秋葵,两个测试(vector_copy和Squares分别)正常运行。我也可以使用相同的设置成功使用aparapi-lambda。

华硕A88x-Pro主板上的硬件为A10-7700k,内存为16Gb。

那么,有谁知道我为什么会收到这些错误?我怀疑GCC hsa分支已经更新,以遵循1.0最终规范,该规范与Okra尚不兼容,这将阻止任何人实际能够使用编译器,直到有人最终更新黄秋葵。但是,我不能太确定。

编辑:这是新的makefile:

GCCHSAIL=$(GCC_HSA)/bin/gcc
LDFLAGS=-lhsa-runtime64 -lhsa-runtime-ext64 -lhsakmt -L $(GCC_HSA)/lib64 -L ~/HSA-Runtime-AMD-master/lib -L opt/hsa/lib -L ~/libhsakmt/build/lnx64a -Wl,-rpath,$(GCC_HSA)/lib64  
CFLAGS=-lm -fopenmp -Wall -O3
all : matmul
clean :
    rm -rf *.o matmul test.output
# GCC Specifics
matmul.o :  matmul.c
    $(GCCHSAIL) -c $(CFLAGS) $< 
matmul : matmul.o 
    $(GCCHSAIL) matmul.o $(CFLAGS) -o $@  $(LDFLAGS)

旧的makefile没有引用所需的.so文件的开关。使用新的makefile,现在我收到以下错误:

/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_ext_program_add_module'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_executable_symbol_get_info'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_executable_load_code_object'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_executable_freeze'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_executable_create'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_executable_get_symbol'
/hsailgcc/lib64/libgomp.so: undefined reference to `hsa_ext_program_finalize'

现在错误较少,无论出于何种原因,其中7个仍然存在。

编辑编辑:问题解决了。 GCC hsa分支已经开始支持HSA 1.0F,不再依赖于秋葵。这意味着我用来维护Okra兼容性的旧驱动程序组件和旧运行时与GCC hsa的当前版本不兼容。这应该足够简单来解决。感谢编译器开关的所有帮助。

0 个答案:

没有答案