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
30 changes: 15 additions & 15 deletions apps/ios_rpc/tvmrpc/RPCServer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ @interface RPCServerBase : RPCServer
*/
- (bool)onReadHandler; // return true - continue feeding, false - stop, try to drain output buffer
- (bool)onWriteHandler; // return true - continue draining, false - no data to write
- (void)onEndEncountered; // called on disconnect or session desided that it's shutdown time
- (void)onEndEncountered; // called on disconnect or session decided that it's shutdown time
- (void)open; // Initiate listening objects like i/o streams and other resources
- (void)close; // Deinitialize resources opend in "open" method
@end

@implementation RPCServerBase {
// Worker thread
NSThread* worker_thread_;
// Triger to continue RunLoop processing inside worker_thread_
// Trigger to continue RunLoop processing inside worker_thread_
BOOL shouldKeepRunning;
// Input socket stream
@protected
Expand All @@ -143,7 +143,7 @@ @implementation RPCServerBase {
}

/*!
* Start internal worker thread with RunLoop and submit correspoding open handlers into it
* Start internal worker thread with RunLoop and submit corresponding open handlers into it
* Not blocking
*/
- (void)start {
Expand All @@ -169,7 +169,7 @@ - (void)stop {
if (worker_thread_ == nil) return;

[self performSelector:@selector(stop_) onThread:worker_thread_ withObject:nil waitUntilDone:NO];
worker_thread_ = nil; // TODO: is it valide? may be better to do that inside NSThread?
worker_thread_ = nil; // TODO: is it valid? may be better to do that inside NSThread?
}

- (void)stop_ {
Expand All @@ -178,7 +178,7 @@ - (void)stop_ {
}

/*!
* Base implementation to selup i/o streams
* Base implementation to setup i/o streams
* Will connect to host and port specified in corresponding properties
*/
- (void)open {
Expand All @@ -197,7 +197,7 @@ - (void)open {
}

/*!
* Base implementation to selup i/o streams
* Base implementation to setup i/o streams
* Will assign i/o streams to provided socket connection.
*/
- (void)openWithSocket:(CFSocketNativeHandle)sock {
Expand All @@ -215,7 +215,7 @@ - (void)openWithSocket:(CFSocketNativeHandle)sock {
}

/*!
* Close i/o streams assosiated with connection
* Close i/o streams associated with connection
*/
- (void)close {
[inputStream_ close];
Expand All @@ -239,7 +239,7 @@ - (void)onEndEncountered {
}

/*!
* Try to read data from stream and call processing hadnler
* Try to read data from stream and call processing handler
*/
- (void)tryToRead {
const int kBufferSize = 4 << 10; // 4kB buffer
Expand All @@ -255,7 +255,7 @@ - (void)tryToRead {
}

/*!
* Try to write remaining data to stream and call processing hadnler
* Try to write remaining data to stream and call processing handler
*/
- (void)tryToWrite {
if (!sendBuffer_.empty()) {
Expand Down Expand Up @@ -307,7 +307,7 @@ - (void)stream:(NSStream*)strm handleEvent:(NSStreamEvent)event {
#pragma mark - Helpers

/*!
* Set buffer to send into stream. Try to send immediatly or submit to lazy sending
* Set buffer to send into stream. Try to send immediately or submit to lazy sending
* Non blocking operation
*/
- (void)toSend:(NSData*)data {
Expand Down Expand Up @@ -412,7 +412,7 @@ - (instancetype)init {
* Implement matching of internat state on state available for outside users
*/
- (void)setState:(RPCServerProxyState)new_state {
// Send Connected notification because Proxy doesn't responce until client connected.
// Send Connected notification because Proxy doesn't response until client connected.
if (new_state == RPCServerProxyState_HandshakeToRecv)
[self notifyState:RPCServerStatus_Connected];
if (new_state == RPCServerProxyState_Idle) [self notifyState:RPCServerStatus_Disconnected];
Expand Down Expand Up @@ -465,7 +465,7 @@ - (bool)onReadHandler {
if (data == nil) return FALSE;

if (*(int32_t*)data.bytes != tvm::runtime::kRPCMagic) {
[self notifyError:@"Wrong responce, is not RPC client."];
[self notifyError:@"Wrong response, is not RPC client."];
[self close];
return FALSE;
break;
Expand Down Expand Up @@ -720,7 +720,7 @@ - (bool)onReadHandler {
if (data == nil) return FALSE;

if (*(int*)data.bytes != tvm::runtime::kRPCTrackerMagic) {
[self notifyError:@"Wrong responce, is not RPC Tracker."];
[self notifyError:@"Wrong response, is not RPC Tracker."];
[self close];
return FALSE;
break;
Expand All @@ -734,7 +734,7 @@ - (bool)onReadHandler {
if (data == nil) return FALSE;

if (std::string((char*)data.bytes, data.length) != resp_OK) {
[self notifyError:@"Failed to Update info on tracker. Responce is not OK."];
[self notifyError:@"Failed to Update info on tracker. Response is not OK."];
[self close];
return FALSE;
break;
Expand All @@ -748,7 +748,7 @@ - (bool)onReadHandler {
if (data == nil) return FALSE;

if (std::string((char*)data.bytes, data.length) != resp_OK) {
[self notifyError:@"Failed to Put server into tracker. Responce is not OK."];
[self notifyError:@"Failed to Put server into tracker. Response is not OK."];
[self close];
return FALSE;
break;
Expand Down
2 changes: 1 addition & 1 deletion apps/ios_rpc/tvmrpc/TVMRuntime.mm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void LogMessageImpl(const std::string& file, int lineno, int level, const std::s
base = [[bundle privateFrameworksPath] stringByAppendingPathComponent:@"tvm"];

if (Registry::Get("runtime.module.loadfile_dylib_custom")) {
// Custom dso laoder is present. Will use it.
// Custom dso loader is present. Will use it.
base = NSTemporaryDirectory();
fmt = "dylib_custom";
}
Expand Down
2 changes: 1 addition & 1 deletion docs/contribute/document.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ shows an example of c++ docstring.
/*!
* \brief Description of my function
* \param arg1 Description of arg1
* \param arg2 Descroption of arg2
* \param arg2 Description of arg2
* \returns describe return value
*/
int myfunction(int arg1, int arg2) {
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/relax/expr_functor.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace relax {
*
* \sa tvm/ir_functor.h
*
* \tparam FType function signiture
* \tparam FType function signature
* This type is only defined for FType with function signature R(const Expr&,
* Args...)
*/
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/relax/op_attr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ using FNormalize = runtime::TypedPackedFunc<Expr(const BlockBuilder& bb, Call ca
* this delay between generating an ill-formed `relax::Call` and
* identifying the ill-formed call may complicate debugging. If
* the validation logic is very fast to check, and doing so would
* not introduce a signficant overhead, consider validating as part
* not introduce a significant overhead, consider validating as part
* of `FNormalize`, which is applied by the block builder for each
* `relax::Call`.
*
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/relax/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ShapeType : public Type {
class TensorTypeNode : public TypeNode {
public:
/*!
* \brief The number of dimensions of the tensor, use -1 to denote tensor with unknwon number of
* \brief The number of dimensions of the tensor, use -1 to denote tensor with unknown number of
* dimensions.
*/
int ndim;
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/tir/analysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ struct MemCpyDetails {
TVM_DLL std::optional<MemCpyDetails> IdentifyMemCpy(const For& loop, arith::Analyzer* analyzer);

/*!
* \brief Calculate the expresion complexity based on number of symbols it contains.
* \brief Calculate the expression complexity based on number of symbols it contains.
* \param expr The expr to be calculated.
*/
TVM_DLL size_t CalculateExprComplexity(const PrimExpr& expr);
Expand Down
4 changes: 2 additions & 2 deletions include/tvm/tir/block_dependence_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace tir {
class BlockDependenceInfoNode : public Object {
public:
/*!
* \brief Mapping from a block sref to its correpsonding BlockScope,
* \brief Mapping from a block sref to its corresponding BlockScope,
* tracking the dependency inside the block scope,
*/
std::unordered_map<StmtSRef, BlockScope, ObjectPtrHash, ObjectPtrEqual> sref2scope;
Expand All @@ -66,7 +66,7 @@ class BlockDependenceInfoNode : public Object {
TVM_DECLARE_FINAL_OBJECT_INFO(BlockDependenceInfoNode, Object);

/*!
* \brief Get the BlockScope correpsonding to the sref of scope root block
* \brief Get the BlockScope corresponding to the sref of scope root block
* \param scope_root The block sref to be retrieved
* \return The corresponding BlockScope
*/
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/tir/builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ TVM_DLL const Op& tvm_storage_sync();
* __shfl_down_sync and __activemask.
*
* Parameter warp_size is the size of a warp, which helps a backend
* to determine wheter the width paramter is legal.
* to determine whether the width parameter is legal.
*
*/
TVM_DLL const Op& tvm_warp_shuffle();
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/tir/op.h
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ TVM_DLL PrimExpr pow(PrimExpr x, PrimExpr y, Span span = Span());
* \param x The input data
* \param span The location of this operation in the source.
*
* \return The aboslute value of input data x
* \return The absolute value of input data x
*/
TVM_DLL PrimExpr abs(PrimExpr x, Span span = Span());
/*!
Expand Down
2 changes: 1 addition & 1 deletion web/emcc/tvmjs_support.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ TVM_DLL int TVMWasmFuncCreateFromCFunc(void* resource_handle, TVMFunctionHandle*
* \param type_codes The type codes of the arguments
* \param num_args Number of arguments.
* \param ret The return value handle.
* \param resource_handle The handle additional resouce handle from fron-end.
* \param resource_handle The handle additional resource handle from front-end.
* \return 0 if success, -1 if failure happens, set error via TVMAPISetLastError.
*/
extern int TVMWasmPackedCFunc(TVMValue* args, int* type_codes, int num_args, TVMRetValueHandle ret,
Expand Down
2 changes: 1 addition & 1 deletion web/emcc/wasm_runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ TVM_REGISTER_GLOBAL("testing.wrap_callback").set_body([](TVMArgs args, TVMRetVal
// internal function used for debug and testing purposes
TVM_REGISTER_GLOBAL("testing.object_use_count").set_body([](TVMArgs args, TVMRetValue* ret) {
runtime::ObjectRef obj = args[0];
// substract the current one because we always copy
// subtract the current one because we always copy
// and get another value.
*ret = (obj.use_count() - 1);
});
Expand Down