Skip to content
Open
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
4 changes: 2 additions & 2 deletions libnd4j/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ if (SD_CUDA)
enable_language(CUDA)
set(CMAKE_CUDA_STANDARD 11)

set(DEFAULT_ENGINE "samediff::ENGINE_CUDA")
set(DEFAULT_ENGINE "sd::ENGINE_CUDA")
else()
set(DEFAULT_ENGINE "samediff::ENGINE_CPU")
set(DEFAULT_ENGINE "sd::ENGINE_CPU")
endif()

# MSVC runtime lib can be either "MultiThreaded" or "MultiThreadedDLL", /MT and /MD respectively
Expand Down
8 changes: 4 additions & 4 deletions libnd4j/include/array/DataTypeConversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace sd {
buffer[e] = canKeep ? static_cast<T>(tmp[e]) : BitwiseUtils::swap_bytes<T>(static_cast<T>(tmp[e]));
};

samediff::Threads::parallel_for(func, 0, length);
sd::Threads::parallel_for(func, 0, length);
#endif

delete[] tmp;
Expand Down Expand Up @@ -114,7 +114,7 @@ namespace sd {
buffer[e] = canKeep ? static_cast<T>(tmp[e]) : BitwiseUtils::swap_bytes<T>(static_cast<T>(tmp[e]));
};

samediff::Threads::parallel_for(func, 0, length);
sd::Threads::parallel_for(func, 0, length);
#endif

delete[] tmp;
Expand Down Expand Up @@ -142,7 +142,7 @@ namespace sd {
buffer[e] = canKeep ? static_cast<T>(tmp[e]) : BitwiseUtils::swap_bytes<T>(static_cast<T>(tmp[e]));
};

samediff::Threads::parallel_for(func, 0, length);
sd::Threads::parallel_for(func, 0, length);
#endif
delete[] tmp;
}
Expand All @@ -168,7 +168,7 @@ namespace sd {
buffer[e] = canKeep ? static_cast<T>(tmp[e]) : BitwiseUtils::swap_bytes<T>(static_cast<T>(tmp[e]));
};

samediff::Threads::parallel_for(func, 0, length);
sd::Threads::parallel_for(func, 0, length);
#endif
delete[] tmp;
}
Expand Down
20 changes: 10 additions & 10 deletions libnd4j/include/array/NDArray.hXX
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ NDArray::NDArray(const std::vector<Nd4jLong>& shape, const std::vector<const cha
}
};

samediff::Threads::parallel_for(func, 0, lengthOf(), 1);
sd::Threads::parallel_for(func, 0, lengthOf(), 1);

tickWriteHost();
syncToDevice();
Expand Down Expand Up @@ -581,7 +581,7 @@ NDArray::NDArray(const std::vector<Nd4jLong>& shape, const std::vector<std::stri
}
};

samediff::Threads::parallel_for(func, 0, lengthOf(), 1);
sd::Threads::parallel_for(func, 0, lengthOf(), 1);


tickWriteHost();
Expand Down Expand Up @@ -647,7 +647,7 @@ NDArray::NDArray(const std::vector<Nd4jLong>& shape, const std::vector<std::u16s
}
}
};
samediff::Threads::parallel_for(func, 0, lengthOf(), 1);
sd::Threads::parallel_for(func, 0, lengthOf(), 1);

tickWriteHost();
syncToDevice();
Expand Down Expand Up @@ -713,7 +713,7 @@ NDArray::NDArray(const std::vector<Nd4jLong>& shape, const std::vector<const cha
}
}
};
samediff::Threads::parallel_for(func, 0, lengthOf(), 1);
sd::Threads::parallel_for(func, 0, lengthOf(), 1);

tickWriteHost();
syncToDevice();
Expand Down Expand Up @@ -779,7 +779,7 @@ NDArray::NDArray(const std::vector<Nd4jLong>& shape, const std::vector<std::u32s
}
}
};
samediff::Threads::parallel_for(func, 0, lengthOf(), 1);
sd::Threads::parallel_for(func, 0, lengthOf(), 1);

tickWriteHost();
syncToDevice();
Expand Down Expand Up @@ -845,7 +845,7 @@ NDArray::NDArray(const std::vector<Nd4jLong>& shape, const std::vector<const cha
}
}
};
samediff::Threads::parallel_for(func, 0, lengthOf(), 1);
sd::Threads::parallel_for(func, 0, lengthOf(), 1);

tickWriteHost();
syncToDevice();
Expand Down Expand Up @@ -2392,7 +2392,7 @@ NDArray NDArray::asS() const {
}
};

samediff::Threads::parallel_for(func, 0, lengthOf(), 1);
sd::Threads::parallel_for(func, 0, lengthOf(), 1);

registerPrimaryUse({ &res }, { this });

Expand Down Expand Up @@ -3490,7 +3490,7 @@ NDArray NDArray::dup(const char newOrder) const {
}
};

samediff::Threads::parallel_for(func, 0, lengthOf(), 1);
sd::Threads::parallel_for(func, 0, lengthOf(), 1);

return NDArray(getShapeAsVector(), strings, dataType(), getContext());
}
Expand All @@ -3503,7 +3503,7 @@ NDArray NDArray::dup(const char newOrder) const {
}
};

samediff::Threads::parallel_for(func, 0, lengthOf(), 1);
sd::Threads::parallel_for(func, 0, lengthOf(), 1);

return NDArray(getShapeAsVector(), strings, dataType(), getContext());
}
Expand All @@ -3515,7 +3515,7 @@ NDArray NDArray::dup(const char newOrder) const {
}
};

samediff::Threads::parallel_for(func, 0, lengthOf(), 1);
sd::Threads::parallel_for(func, 0, lengthOf(), 1);

return NDArray(getShapeAsVector(), strings, dataType(), getContext());
}
Expand Down
10 changes: 5 additions & 5 deletions libnd4j/include/array/cpu/NDArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void NDArray::fillAsTriangular(const float val, int lower, int upper, NDArray& t
}
};

samediff::Threads::parallel_for(func, 0, zLen);
sd::Threads::parallel_for(func, 0, zLen);
}
BUILD_SINGLE_TEMPLATE(template void NDArray::fillAsTriangular, (const float val, int lower, int upper, NDArray& target, const char direction), LIBND4J_TYPES);

Expand Down Expand Up @@ -166,7 +166,7 @@ static void templatedSwap(void *xBuffer, void *yBuffer, Nd4jLong length) {
}
};

samediff::Threads::parallel_for(func, 0, length);
sd::Threads::parallel_for(func, 0, length);
}
BUILD_SINGLE_TEMPLATE(template void templatedSwap, (void *xBuffer, void *yBuffer, Nd4jLong length), LIBND4J_TYPES);

Expand Down Expand Up @@ -279,7 +279,7 @@ NDArray NDArray::tile(const std::vector<Nd4jLong>& reps) const {
}
};

samediff::Threads::parallel_for(func, 0, resultLen);
sd::Threads::parallel_for(func, 0, resultLen);
}
else {

Expand All @@ -291,7 +291,7 @@ NDArray NDArray::tile(const std::vector<Nd4jLong>& reps) const {
}
};

samediff::Threads::parallel_for(func, 0, resultLen);
sd::Threads::parallel_for(func, 0, resultLen);
}
result.tickWriteHost();
return result;
Expand Down Expand Up @@ -410,7 +410,7 @@ static void repeat_(const NDArray& input, NDArray& output, const std::vector<int
}
};

samediff::Threads::parallel_for(func, 0, zLen);
sd::Threads::parallel_for(func, 0, zLen);
}

//////////////////////////////////////////////////////////////////////////
Expand Down
30 changes: 15 additions & 15 deletions libnd4j/include/array/cpu/NDArrayLambda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void NDArray::applyTriplewiseLambda(NDArray& second, NDArray& third, const std::
z[e] = func(f[e], s[e], t[e]);
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
} else {
if (f == z) {

Expand All @@ -40,7 +40,7 @@ void NDArray::applyTriplewiseLambda(NDArray& second, NDArray& third, const std::
}
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
} else {

auto loop = PRAGMA_THREADS_FOR {
Expand All @@ -54,7 +54,7 @@ void NDArray::applyTriplewiseLambda(NDArray& second, NDArray& third, const std::
}
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
}
}
}
Expand Down Expand Up @@ -97,7 +97,7 @@ void NDArray::applyPairwiseLambda(const NDArray& other, const std::function<T(T,
z[e] = func(f[e], s[e]);
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
} else {
if (f == z) {

Expand All @@ -110,7 +110,7 @@ void NDArray::applyPairwiseLambda(const NDArray& other, const std::function<T(T,
}
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
} else {

auto loop = PRAGMA_THREADS_FOR {
Expand All @@ -123,7 +123,7 @@ void NDArray::applyPairwiseLambda(const NDArray& other, const std::function<T(T,
}
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
}
}
}
Expand Down Expand Up @@ -160,7 +160,7 @@ void NDArray::applyLambda(const std::function<T(T)>& func, NDArray& target) {
z[e] = func(f[e]);
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
} else {
if (f == z) {

Expand All @@ -172,7 +172,7 @@ void NDArray::applyLambda(const std::function<T(T)>& func, NDArray& target) {
}
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
} else {

auto loop = PRAGMA_THREADS_FOR {
Expand All @@ -184,7 +184,7 @@ void NDArray::applyLambda(const std::function<T(T)>& func, NDArray& target) {
}
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
}
}
}
Expand Down Expand Up @@ -221,7 +221,7 @@ void NDArray::applyIndexedLambda(const std::function<T(Nd4jLong, T)>& func, NDAr
z[e] = func(e, f[e]);
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
} else {
if (f == z) {

Expand All @@ -233,7 +233,7 @@ void NDArray::applyIndexedLambda(const std::function<T(Nd4jLong, T)>& func, NDAr
}
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
} else {

auto loop = PRAGMA_THREADS_FOR {
Expand All @@ -245,7 +245,7 @@ void NDArray::applyIndexedLambda(const std::function<T(Nd4jLong, T)>& func, NDAr
}
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
}
}
}
Expand Down Expand Up @@ -287,7 +287,7 @@ void NDArray::applyIndexedPairwiseLambda(NDArray& other, const std::function<T(N
z[e] = func((Nd4jLong) e, f[e], s[e]);
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
} else {
if (f == z) {

Expand All @@ -300,7 +300,7 @@ void NDArray::applyIndexedPairwiseLambda(NDArray& other, const std::function<T(N
}
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
} else {

auto loop = PRAGMA_THREADS_FOR {
Expand All @@ -313,7 +313,7 @@ void NDArray::applyIndexedPairwiseLambda(NDArray& other, const std::function<T(N
}
};

samediff::Threads::parallel_for(loop, 0, _length);
sd::Threads::parallel_for(loop, 0, _length);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion libnd4j/include/execution/BlockingQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <atomic>
#include <condition_variable>

namespace samediff {
namespace sd {
template <typename T>
class BlockingQueue {
private:
Expand Down
2 changes: 1 addition & 1 deletion libnd4j/include/execution/CallableInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <mutex>
#include <condition_variable>

namespace samediff {
namespace sd {
/**
* This class is suited for passing functions to execution threads without queues
*/
Expand Down
2 changes: 1 addition & 1 deletion libnd4j/include/execution/CallableWithArguments.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <condition_variable>
#include <system/op_boilerplate.h>

namespace samediff {
namespace sd {
class CallableWithArguments {
FUNC_DO _function_do;
FUNC_1D _function_1d;
Expand Down
2 changes: 1 addition & 1 deletion libnd4j/include/execution/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef SD_ENGINE_H
#define SD_ENGINE_H

namespace samediff {
namespace sd {
enum Engine {
ENGINE_CPU = 0,
ENGINE_CUDA = 1,
Expand Down
2 changes: 1 addition & 1 deletion libnd4j/include/execution/ExecutionMode.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef SD_EXECUTIONMODE_H
#define SD_EXECUTIONMODE_H

namespace samediff {
namespace sd {
enum ExecutionMode {
MODE_UNDEFINED = 0,
MODE_TRAINING = 1,
Expand Down
2 changes: 1 addition & 1 deletion libnd4j/include/execution/ThreadPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <execution/Ticket.h>
#include <queue>

namespace samediff {
namespace sd {
class ND4J_EXPORT ThreadPool {
private:
static ThreadPool* _INSTANCE;
Expand Down
Loading