[example/tensorflow] no longer hardcoding library dir

This commit is contained in:
Philippe Tillet
2019-06-11 11:06:02 -07:00
parent 7d50b87681
commit cbd916994d
2 changed files with 6 additions and 1 deletions

View File

@@ -7,4 +7,9 @@ if(${TensorFlow_FOUND})
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=${TF_ABI})
add_library(tf_blocksparse SHARED dot.cpp)
target_link_libraries(tf_blocksparse tensorflow_framework triton)
add_custom_command(
TARGET tf_blocksparse POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/run.py
${CMAKE_CURRENT_BINARY_DIR}/run.py)
endif()

View File

@@ -3,7 +3,7 @@ import tensorflow as tf
import numpy as np
from time import time
data_files_path = tf.resource_loader.get_data_files_path()
library_dir = '/home/philippe/development/triton/build/examples/python/tensorflow'
library_dir = os.path.dirname(os.path.realpath(__file__))
module = tf.load_op_library(os.path.join(library_dir, 'libtf_blocksparse.so'))
M, N, K = 256,256,256