Commit ac74df59 authored by Mccaskey, Alex's avatar Mccaskey, Alex

fixing perpetual exatensor build

Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent 6564b623
......@@ -14,7 +14,7 @@ add_dependencies(${LIBRARY_NAME} exatensor-build)
target_include_directories(
${LIBRARY_NAME}
PRIVATE ${CMAKE_SOURCE_DIR}/tpls/ExaTensor/include ${CMAKE_SOURCE_DIR}/src/utility)
PRIVATE ${CMAKE_SOURCE_DIR}/tpls/ExaTensor/include ${CMAKE_SOURCE_DIR}/src/utility ${CUDA_INCLUDE_DIRS})
set(_bundle_name exatn_example_tensormethod)
......
#include "ExampleTensorMethod.hpp"
#include "talshxx.hpp"
#include <iostream>
namespace exatn {
namespace test {
void ExampleTensorMethod::pack(BytePacket& packet) {
appendToBytePacket(&packet, data);
appendToBytePacket(&packet, datum);
}
void ExampleTensorMethod::unpack(BytePacket &packet) {
extractFromBytePacket(&packet, data);
extractFromBytePacket(&packet, datum);
}
int ExampleTensorMethod::apply(const TensorDenseBlock& local_tensor) {
......@@ -18,6 +21,15 @@ int ExampleTensorMethod::apply(const TensorDenseBlock& local_tensor) {
// local_tensor.num_dims=1;
// local_tensor.data_kind = 1;
// local_tensor.body_ptr = (void*) data;
auto nElements = 10;// getDenseTensorVolume(local_tensor);
for (int i = 0; i < nElements; i++) {
if (local_tensor.data_kind == ::talsh::TensorData<double>::kind) {
((double*)local_tensor.body_ptr)[i] = datum;
} else {
std::cerr << "can't handle any other data type.\n";
}
}
return 0;
......
......@@ -7,8 +7,7 @@ class ExampleTensorMethod : public TensorMethod<Identifiable> {
protected:
// FIXME Dmitry provide an example implementation for this
int data = 1;
double datum = 0.001;
public:
......@@ -16,7 +15,7 @@ public:
void unpack(BytePacket& packet) override;
int apply(const TensorDenseBlock& local_tensor) override;
const std::string name() const override { return "example-tensor-method"; }
const std::string name() const override { return "HamiltonianTest"; }
const std::string description() const override {
return "";
}
......
......@@ -39,6 +39,11 @@ if(EXATN_BUILD_TESTS)
endmacro()
endif()
set(TALSHXX_EXISTS "NO")
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ExaTensor/include/talshxx.hpp")
set(TALSHXX_EXISTS "YES")
endif()
list(GET MPI_Fortran_INCLUDE_PATH 0 MPI_FORTRAN_INCLUDE)
get_filename_component(MPI_ROOT_DIR ${MPI_FORTRAN_INCLUDE} DIRECTORY)
get_filename_component(MPI_BIN_PATH ${MPI_CXX_COMPILER} DIRECTORY)
......@@ -57,7 +62,7 @@ if(CUDA_FOUND)
exatensor-build
COMMAND ${CMAKE_COMMAND} -E env CPP_GNU=g++-8 CC_GNU=gcc-8 FC_GNU=gfortran-8 GPU_CUDA=CUDA
PATH_CUDA=${CUDA_TOOLKIT_ROOT_DIR} MPILIB=OPENMPI BLASLIB=ATLAS
PATH_OPENMPI_INC=${MPI_ROOT_DIR}/include
PATH_OPENMPI_INC=${MPI_ROOT_DIR}/include EXA_NO_BUILD=${TALSHXX_EXISTS}
PATH_OPENMPI_LIB=${MPI_ROOT_DIR}/lib
PATH_OPENMPI_BIN=${MPI_BIN_PATH} CUDA_HOST_COMPILER=${CUDA_HOST_COMPILER}
make
......@@ -67,7 +72,7 @@ if(CUDA_FOUND)
exatensor-build
COMMAND ${CMAKE_COMMAND} -E env CPP_GNU=g++-8 CC_GNU=gcc-8 FC_GNU=gfortran-8 GPU_CUDA=CUDA
PATH_CUDA=${CUDA_TOOLKIT_ROOT_DIR} MPILIB=OPENMPI BLASLIB=ATLAS
PATH_OPENMPI_INC=${MPI_ROOT_DIR}/include
PATH_OPENMPI_INC=${MPI_ROOT_DIR}/include EXA_NO_BUILD=${TALSHXX_EXISTS}
PATH_OPENMPI_LIB=${MPI_ROOT_DIR}/lib
PATH_OPENMPI_BIN=${MPI_BIN_PATH} CUDA_HOST_COMPILER=${CMAKE_CXX_COMPILER} make
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ExaTensor)
......@@ -76,8 +81,8 @@ else()
add_custom_target(
exatensor-build
COMMAND ${CMAKE_COMMAND} -E env CPP_GNU=g++-8 CC_GNU=gcc-8 FC_GNU=gfortran-8 MPILIB=OPENMPI BLASLIB=ATLAS
PATH_OPENMPI_INC=${MPI_ROOT_DIR}/include
PATH_OPENMPI_INC=${MPI_ROOT_DIR}/include EXA_NO_BUILD=${TALSHXX_EXISTS}
PATH_OPENMPI_LIB=${MPI_ROOT_DIR}/lib
PATH_OPENMPI_BIN=${MPI_BIN_PATH} make
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ExaTensor)
endif()
endif()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment