我正在尝试为 tensorflow 的一些实验添加外部头文件(如 OpenCL 头文件)。我尝试将其添加到 tensorflow/core/BUILD 文件下的 BUILD 文件中:
# This includes implementations of all kernels built into TensorFlow.
cc_library(
name = "all_kernels",
visibility = ["//visibility:public"],
copts = tf_copts() + ["-Ithird_party/include"], <==== this is the line I added
我还在此目录中创建了一个软链接,指向来自 OpenCL 驱动程序(在 tensorflow/third_party 下)的这些头文件的位置(如 ln -s /opt/opencl/ ),但它仍然抱怨它没有找到该头文件。
如果我直接添加外部头文件(如 /opt/opencl/CL/),它会抱怨无法包含外部文件(或类似的东西)。
我也没有 root 密码来将这些头文件复制到 /usr/include/ 中。
有人能解释一下如何将外部头文件放入 tensorflow 中进行构建吗?
感谢您的快速帮助。