forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major improvements to master-worker mode
* Fixed all undefined symbol errors * Implemented storage interface and THStorage class * RPC improvements * Code refactor
- Loading branch information
Showing
41 changed files
with
1,290 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
#include "Module.h" | ||
#include "Storage.h" | ||
#include "Tensor.h" | ||
#ifdef _THP_CORE | ||
#include "utils.h" | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
#include <Python.h> | ||
#include "utils.h" | ||
#include "THDP.h" | ||
|
||
#include "override_macros.h" | ||
|
||
template<> | ||
void THPPointer<THDTensorDescriptor>::free() { | ||
if (ptr) | ||
THDTensorDescriptor_free(ptr); | ||
} | ||
|
||
template class THPPointer<THDTensorDescriptor>; | ||
|
||
#define THD_GENERIC_FILE "torch/csrc/generic/utils.cpp" | ||
#include <THD/base/THDGenerateAllTypes.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#pragma once | ||
|
||
#include "Type.hpp" | ||
|
||
#include <cstddef> | ||
#include <cstdint> | ||
#include <initializer_list> | ||
#include <type_traits> | ||
#include <unordered_map> | ||
#include <vector> | ||
|
||
namespace thd { | ||
|
||
struct Storage { | ||
Storage() {}; | ||
Storage(const Storage& other) = delete; | ||
Storage(Storage&& other) = delete; | ||
virtual ~Storage() {}; | ||
|
||
virtual std::size_t elementSize() const = 0; | ||
virtual std::size_t size() const = 0; | ||
virtual void* data() = 0; | ||
virtual const void* data() const = 0; | ||
virtual Storage& retain() = 0; | ||
virtual Storage& free() = 0; | ||
|
||
virtual Storage& resize(long new_size) = 0; | ||
|
||
virtual thd::Type type() const = 0; | ||
}; | ||
|
||
template<typename real> | ||
struct StorageScalarInterface : public Storage { | ||
using scalar_type = real; | ||
virtual StorageScalarInterface& fill(scalar_type value) = 0; | ||
}; | ||
|
||
using FloatStorage = StorageScalarInterface<double>; | ||
using IntStorage = StorageScalarInterface<long long>; | ||
|
||
} // namespace thd | ||
|
Oops, something went wrong.