Skip to content

Commit

Permalink
Merge branch 'master' into fix-compiler-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dmed256 authored May 30, 2020
2 parents e144223 + afc69bf commit d60edee
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 22 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@ if (ENABLE_TESTS)
endif()

install(DIRECTORY include/ DESTINATION include)

include(Summary)
4 changes: 0 additions & 4 deletions cmake/CUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ if (CUDA_FOUND)
set(WITH_CUDA 1)
set(OCCA_CUDA_ENABLED 1)
include_directories( ${CUDA_INCLUDE_DIRS} )

message(STATUS "CUDA version: ${CUDA_VERSION_STRING}")
message(STATUS "CUDA Include Paths: ${CUDA_INCLUDE_DIRS}")
message(STATUS "CUDA Libraries: ${CUDA_LIBRARIES}")
else (CUDA_FOUND)
set(WITH_CUDA 0)
set(OCCA_CUDA_ENABLED 0)
Expand Down
4 changes: 0 additions & 4 deletions cmake/HIP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ if (HIP_FOUND)
add_definitions(-D${HIP_RUNTIME_DEFINE})
include_directories( ${HIP_INCLUDE_DIRS} )

message(STATUS "HIP version: ${HIP_VERSION_STRING}")
message(STATUS "HIP platform: ${HIP_PLATFORM}")
message(STATUS "HIP Include Paths: ${HIP_INCLUDE_DIRS}")
message(STATUS "HIP Libraries: ${HIP_LIBRARIES}")
else (HIP_FOUND)
set(WITH_HIP 0)
set(OCCA_HIP_ENABLED 0)
Expand Down
63 changes: 63 additions & 0 deletions cmake/Summary.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
message("Configuration summary")
message(" System: ${CMAKE_SYSTEM}")
message(" CXX compiler: ${CMAKE_CXX_COMPILER} (${CMAKE_CXX_COMPILER_ID})")
message(" CXX FLAGS: ${CMAKE_CXX_FLAGS}")
message(" C compiler: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID})")
message(" C FLAGS: ${CMAKE_C_FLAGS}\n")

if (CUDA_FOUND)
message(" With CUDA: ON")
message(" CUDA version: ${CUDA_VERSION_STRING}")
message(" CUDA include dirs: ${CUDA_INCLUDE_DIRS}")
message(" CUDA libraries: ${CUDA_LIBRARIES}")
else()
message(" With CUDA: OFF")
endif()

if (MPI_FOUND)
message(" With MPI: ON")
message(" MPI version: ${MPI_CXX_VERSION}")
message(" MPI include dirs: ${MPI_CXX_INCLUDE_DIRS}")
message(" MPI libraries: ${MPI_CXX_LIBRARIES}")
message(" MPI link flags: ${MPI_CXX_LINK_FLAGS}")

else()
message(" With MPI: OFF")
endif()

if (OpenMP_FOUND)
message(" With OpenMP: ON")
message(" OpenMP version: ${OpenMP_CXX_VERSION}")
message(" OpenMP flags: ${OpenMP_CXX_FLAGS}")
message(" OpenMP include dirs: ${OpenMP_CXX_INCLUDE_DIRS}")
message(" OpenMP libraries: ${OpenMP_CXX_LIBRARIES}")
else()
message(" With OpenMP: OFF")
endif()

if (OpenCL_FOUND)
message(" With OpenCL: ON")
message(" OpenCL version: ${OpenCL_VERSION_STRING}")
message(" OpenCL include dirs: ${OpenCL_INCLUDE_DIRS}")
message(" OpenCL libraries: ${OpenCL_LIBRARIES}")
else()
message(" With OpenCL: OFF")
endif()

if (WITH_METAL)
message(" With Metal: ON")
else()
message(" With Metal: OFF")
endif()

if (HIP_FOUND)
message(" With HIP: ON")
message(" HIP version: ${HIP_VERSION_STRING}")
message(" HIP platform: ${HIP_PLATFORM}")
message(" HIP include dirs: ${HIP_INCLUDE_DIRS}")
message(" HIP libraries: ${HIP_LIBRARIES}")
else()
message(" With HIP: OFF")
endif()

message("\n")
4 changes: 2 additions & 2 deletions include/occa/lang/builtins/attributes/restrict.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
namespace occa {
namespace lang {
namespace attributes {
class restrict : public attribute_t {
class occaRestrict : public attribute_t {
public:
restrict();
occaRestrict();

virtual const std::string& name() const;

Expand Down
4 changes: 2 additions & 2 deletions include/occa/lang/transforms/builtins/restrict.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ namespace occa {
class qualifier_t;

namespace transforms {
class restrict : public statementTransform {
class occaRestrict : public statementTransform {
public:
const qualifier_t &restrictQualifier;

restrict(const qualifier_t &restrictQualifier_);
occaRestrict(const qualifier_t &restrictQualifier_);

virtual statement_t* transformStatement(statement_t &smnt);
};
Expand Down
10 changes: 5 additions & 5 deletions src/lang/builtins/attributes/restrict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
namespace occa {
namespace lang {
namespace attributes {
restrict::restrict() {}
occaRestrict::occaRestrict() {}

const std::string& restrict::name() const {
const std::string& occaRestrict::name() const {
static std::string name_ = "restrict";
return name_;
}

bool restrict::forVariable() const {
bool occaRestrict::forVariable() const {
return true;
}

bool restrict::forStatement(const int sType) const {
bool occaRestrict::forStatement(const int sType) const {
return (sType & statementType::declaration);
}

bool restrict::isValid(const attributeToken_t &attr) const {
bool occaRestrict::isValid(const attributeToken_t &attr) const {
if (attr.kwargs.size() ||
attr.args.size()) {
attr.printError("[@restrict] does not take arguments");
Expand Down
2 changes: 1 addition & 1 deletion src/lang/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace occa {
addAttribute<attributes::dim>();
addAttribute<attributes::dimOrder>();
addAttribute<attributes::tile>();
addAttribute<attributes::restrict>();
addAttribute<attributes::occaRestrict>();
addAttribute<attributes::implicitArg>();
addAttribute<attributes::globalPtr>();
}
Expand Down
1 change: 0 additions & 1 deletion src/lang/specialMacros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ namespace occa {
token->origin
.from(false, thisToken.origin)
.printError("Expected a token name identifier");
throw;

freeTokenVector(args);
return;
Expand Down
6 changes: 3 additions & 3 deletions src/lang/transforms/builtins/restrict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
namespace occa {
namespace lang {
namespace transforms {
restrict::restrict(const qualifier_t &restrictQualifier_) :
occaRestrict::occaRestrict(const qualifier_t &restrictQualifier_) :
restrictQualifier(restrictQualifier_) {
validStatementTypes = (statementType::functionDecl |
statementType::function);
}

statement_t* restrict::transformStatement(statement_t &smnt) {
statement_t* occaRestrict::transformStatement(statement_t &smnt) {
function_t &func = (
(smnt.type() & statementType::function)
? smnt.to<functionStatement>().function
Expand Down Expand Up @@ -46,7 +46,7 @@ namespace occa {

bool applyRestrictTransforms(statement_t &smnt,
const qualifier_t &restrictQualifier) {
restrict restrictTransform(restrictQualifier);
occaRestrict restrictTransform(restrictQualifier);
return restrictTransform.statementTransform::apply(smnt);
}
}
Expand Down

0 comments on commit d60edee

Please sign in to comment.