Skip to content

Commit

Permalink
[Refactor] Move functional out of experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
dmed256 committed Jan 17, 2021
1 parent fd9ca3c commit 47fd96f
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 52 deletions.
1 change: 1 addition & 0 deletions include/occa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <occa/core.hpp>
#include <occa/dtype.hpp>
#include <occa/functional.hpp>
#include <occa/types.hpp>
#include <occa/utils.hpp>

Expand Down
1 change: 0 additions & 1 deletion include/occa/c/experimental.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define OCCA_C_EXPERIMENTAL_HEADER

#include <occa/c/experimental/kernelBuilder.h>
#include <occa/c/experimental/scope.h>

#ifdef OCCA_JIT
# undef OCCA_JIT
Expand Down
2 changes: 1 addition & 1 deletion include/occa/c/experimental/kernelBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <occa/c/defines.h>
#include <occa/c/types.h>
#include <occa/c/experimental/scope.h>
#include <occa/c/scope.h>

OCCA_START_EXTERN_C

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions include/occa/defines/occa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#include <occa/defines/compiledDefines.hpp>

#define OCCA_MAJOR_VERSION 1
#define OCCA_MINOR_VERSION 0
#define OCCA_PATCH_VERSION 9
#define OCCA_VERSION 10009
#define OCCA_VERSION_STR "1.0.9"
#define OCCA_MINOR_VERSION 2
#define OCCA_PATCH_VERSION 0
#define OCCA_VERSION 10200
#define OCCA_VERSION_STR "1.2.0"

#define OKL_MAJOR_VERSION 1
#define OKL_MINOR_VERSION 0
Expand Down
11 changes: 6 additions & 5 deletions include/occa/defines/okl.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Just in case someone wants to run with an older format than C99
#ifndef OCCA_DISABLE_VARIADIC_MACROS
# ifndef OCCA_DEFINES_OKL_HEADER
# define OCCA_DEFINES_OKL_HEADER
#ifndef OCCA_DEFINES_OKL_HEADER
#define OCCA_DEFINES_OKL_HEADER

#ifdef OCCA_JIT
# undef OCCA_JIT
#endif

#define OCCA_JIT(OKL_SCOPE, OKL_SOURCE) \
do { \
Expand All @@ -12,5 +14,4 @@
_occaJitKernelBuilder.run(OKL_SCOPE); \
} while (false)

# endif
#endif
1 change: 0 additions & 1 deletion include/occa/experimental.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef OCCA_EXPERIMENTAL_HEADER
#define OCCA_EXPERIMENTAL_HEADER

#include <occa/experimental/functional.hpp>
#include <occa/experimental/kernelBuilder.hpp>
#include <occa/experimental/mpi.hpp>

Expand Down
9 changes: 0 additions & 9 deletions include/occa/experimental/functional.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion include/occa/experimental/kernelBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define OCCA_EXPERIMENTAL_CORE_KERNELBUILDER_HEADER

#include <occa/core/kernel.hpp>
#include <occa/experimental/functional/scope.hpp>
#include <occa/functional/scope.hpp>

namespace occa {
class kernelBuilder {
Expand Down
9 changes: 9 additions & 0 deletions include/occa/functional.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef OCCA_FUNCTIONAL_HEADER
#define OCCA_FUNCTIONAL_HEADER

#include <occa/functional/array.hpp>
#include <occa/functional/function.hpp>
#include <occa/functional/scope.hpp>
#include <occa/functional/utils.hpp>

#endif
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#ifndef OCCA_EXPERIMENTAL_FUNCTIONAL_ARRAY_HEADER
#define OCCA_EXPERIMENTAL_FUNCTIONAL_ARRAY_HEADER
#ifndef OCCA_FUNCTIONAL_ARRAY_HEADER
#define OCCA_FUNCTIONAL_ARRAY_HEADER

#include <vector>

#include <occa/defines/okl.hpp>
#include <occa/dtype.hpp>
#include <occa/experimental/functional/function.hpp>
#include <occa/functional/function.hpp>
#include <occa/experimental/kernelBuilder.hpp>

namespace occa {
class kernelArg;

enum reductionType {
enum class reductionType {
sum,
multiply,
bitOr,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef OCCA_EXPERIMENTAL_FUNCTIONAL_FUNCTION_HEADER
#define OCCA_EXPERIMENTAL_FUNCTIONAL_FUNCTION_HEADER
#ifndef OCCA_FUNCTIONAL_FUNCTION_HEADER
#define OCCA_FUNCTIONAL_FUNCTION_HEADER

#include <functional>

#include <occa/experimental/functional/functionDefinition.hpp>
#include <occa/experimental/functional/scope.hpp>
#include <occa/experimental/functional/utils.hpp>
#include <occa/functional/functionDefinition.hpp>
#include <occa/functional/scope.hpp>
#include <occa/functional/utils.hpp>
#include <occa/utils/hash.hpp>
#include <occa/dtype.hpp>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef OCCA_EXPERIMENTAL_FUNCTIONAL_FUNCTIONDEFINITION_HEADER
#define OCCA_EXPERIMENTAL_FUNCTIONAL_FUNCTIONDEFINITION_HEADER
#ifndef OCCA_FUNCTIONAL_FUNCTIONDEFINITION_HEADER
#define OCCA_FUNCTIONAL_FUNCTIONDEFINITION_HEADER

#include <memory>
#include <string>

#include <occa/dtype.hpp>
#include <occa/utils/hash.hpp>
#include <occa/experimental/functional/scope.hpp>
#include <occa/functional/scope.hpp>

namespace occa {
class functionDefinition;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef OCCA_EXPERIMENTAL_FUNCTIONAL_SCOPE_HEADER
#define OCCA_EXPERIMENTAL_FUNCTIONAL_SCOPE_HEADER
#ifndef OCCA_FUNCTIONAL_SCOPE_HEADER
#define OCCA_FUNCTIONAL_SCOPE_HEADER

#include <initializer_list>
#include <map>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef OCCA_EXPERIMENTAL_FUNCTIONAL_UTILS_HEADER
#define OCCA_EXPERIMENTAL_FUNCTIONAL_UTILS_HEADER
#ifndef OCCA_FUNCTIONAL_UTILS_HEADER
#define OCCA_FUNCTIONAL_UTILS_HEADER

#define OCCA_FUNCTION(scope, lambda) \
::occa::inferFunction(scope, lambda, #lambda)
Expand Down
2 changes: 1 addition & 1 deletion src/c/experimental/scope.cpp → src/c/scope.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <occa/internal/c/types.hpp>
#include <occa/c/experimental/scope.h>
#include <occa/c/scope.h>

namespace occa {
static void addToScope(occaScope scope,
Expand Down
2 changes: 1 addition & 1 deletion src/core/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <occa/internal/lang/builtins/types.hpp>
#include <occa/internal/lang/parser.hpp>
#include <occa/internal/utils/sys.hpp>
#include <occa/internal/experimental/functional/functionStore.hpp>
#include <occa/internal/functional/functionStore.hpp>

namespace occa {
//---[ kernel ]-----------------------
Expand Down
2 changes: 1 addition & 1 deletion src/experimental/kernelBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <occa/internal/utils/lex.hpp>
#include <occa/internal/utils/string.hpp>
#include <occa/experimental/kernelBuilder.hpp>
#include <occa/experimental/functional/scope.hpp>
#include <occa/functional/scope.hpp>

namespace occa {
kernelBuilder::kernelBuilder(const std::string &source_,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <occa/experimental/functional/function.hpp>
#include <occa/internal/experimental/functional/functionStore.hpp>
#include <occa/functional/function.hpp>
#include <occa/internal/functional/functionStore.hpp>

namespace occa {
baseFunction::baseFunction(const occa::scope &scope_) :
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <occa/experimental/functional/functionDefinition.hpp>
#include <occa/internal/experimental/functional/functionStore.hpp>
#include <occa/functional/functionDefinition.hpp>
#include <occa/internal/functional/functionStore.hpp>
#include <occa/internal/utils/lex.hpp>
#include <occa/internal/utils/string.hpp>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <sstream>

#include <occa/experimental/functional/scope.hpp>
#include <occa/functional/scope.hpp>

namespace occa {
scope::scope() {}
Expand Down
2 changes: 1 addition & 1 deletion src/occa/internal/c/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define OCCA_INTERNAL_C_TYPES_HEADER

#include <occa/core.hpp>
#include <occa/experimental/functional/scope.hpp>
#include <occa/functional/scope.hpp>
#include <occa/experimental/kernelBuilder.hpp>
#include <occa/internal/utils/sys.hpp>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <occa/internal/experimental/functional/functionStore.hpp>
#include <occa/internal/functional/functionStore.hpp>

namespace occa {
store_t<hash_t, functionDefinition> functionStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <occa/utils/hash.hpp>
#include <occa/internal/utils/store.hpp>
#include <occa/experimental/functional/functionDefinition.hpp>
#include <occa/functional/functionDefinition.hpp>

namespace occa {
extern store_t<hash_t, functionDefinition> functionStore;
Expand Down
2 changes: 1 addition & 1 deletion tests/src/c/kernel.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define OCCA_DISABLE_VARIADIC_MACROS

#include <occa.hpp>
#include <occa.h>
#include <occa.hpp>

#include <occa/internal/io.hpp>
#include <occa/internal/c/types.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <occa.hpp>
#include <occa/experimental.hpp>
#include <occa/internal/experimental/functional/functionStore.hpp>
#include <occa/functional.hpp>
#include <occa/internal/functional/functionStore.hpp>
#include <occa/internal/utils/testing.hpp>

class context {
Expand Down

0 comments on commit 47fd96f

Please sign in to comment.