Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/backend/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ target_sources(afcommon_interface
${CMAKE_CURRENT_SOURCE_DIR}/half.hpp
${CMAKE_CURRENT_SOURCE_DIR}/host_memory.cpp
${CMAKE_CURRENT_SOURCE_DIR}/host_memory.hpp
${CMAKE_CURRENT_SOURCE_DIR}/internal_enums.hpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel_type.hpp
${CMAKE_CURRENT_SOURCE_DIR}/module_loading.hpp
${CMAKE_CURRENT_SOURCE_DIR}/sparse_helpers.hpp
Expand Down
18 changes: 2 additions & 16 deletions src/backend/common/defines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#pragma once

#include <common/internal_enums.hpp>

#include <mutex>
#include <string>

Expand Down Expand Up @@ -41,22 +43,6 @@ inline std::string clipFilePath(std::string path, std::string str) {
#define __AF_FILENAME__ (clipFilePath(__FILE__, "src/").c_str())
#endif

typedef enum {
AF_BATCH_UNSUPPORTED = -1, /* invalid inputs */
AF_BATCH_NONE, /* one signal, one filter */
AF_BATCH_LHS, /* many signal, one filter */
AF_BATCH_RHS, /* one signal, many filter */
AF_BATCH_SAME, /* signal and filter have same batch size */
AF_BATCH_DIFF, /* signal and filter have different batch size */
} AF_BATCH_KIND;

enum class kJITHeuristics {
Pass = 0, /* no eval necessary */
TreeHeight = 1, /* eval due to jit tree height */
KernelParameterSize = 2, /* eval due to many kernel parameters */
MemoryPressure = 3 /* eval due to memory pressure */
};

#ifdef OS_WIN
#include <Windows.h>
using LibHandle = HMODULE;
Expand Down
22 changes: 22 additions & 0 deletions src/backend/common/internal_enums.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*******************************************************
* Copyright (c) 2020, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/

#pragma once

// TODO AF_BATCH_UNSUPPORTED is not required and shouldn't happen
// Code changes are required to handle all cases properly
// and this enum value should be removed.
typedef enum {
AF_BATCH_UNSUPPORTED = -1, /* invalid inputs */
AF_BATCH_NONE, /* one signal, one filter */
AF_BATCH_LHS, /* many signal, one filter */
AF_BATCH_RHS, /* one signal, many filter */
AF_BATCH_SAME, /* signal and filter have same batch size */
AF_BATCH_DIFF, /* signal and filter have different batch size */
} AF_BATCH_KIND;
7 changes: 7 additions & 0 deletions src/backend/common/jit/Node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
#include <unordered_map>
#include <vector>

enum class kJITHeuristics {
Pass = 0, /* no eval necessary */
TreeHeight = 1, /* eval due to jit tree height */
KernelParameterSize = 2, /* eval due to many kernel parameters */
MemoryPressure = 3 /* eval due to memory pressure */
};

namespace common {
class Node;
struct Node_ids;
Expand Down
1 change: 1 addition & 0 deletions src/backend/cpu/Array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <Param.hpp>
#include <common/ArrayInfo.hpp>
#include <common/MemoryManagerBase.hpp>
#include <common/jit/Node.hpp>
#include <jit/Node.hpp>
#include <memory.hpp>
#include <platform.hpp>
Expand Down
Loading