Skip to content

Commit

Permalink
[core] Cover cpplint for ray/src/ray/internal (#50662)
Browse files Browse the repository at this point in the history
Signed-off-by: win5923 <[email protected]>
  • Loading branch information
win5923 authored Feb 25, 2025
1 parent 62a68ae commit 7c8e1c8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ repos:
hooks:
- id: cpplint
args: ["--filter=-whitespace/braces,-whitespace/line_length,-build/c++11,-build/c++14,-build/c++17,-readability/braces,-whitespace/indent_namespace,-runtime/int,-runtime/references,-build/include_order"]
files: ^src/ray/(util|raylet_client|scheduling|pubsub|rpc(?:/.*)?)/.*\.(h|cc)$
files: ^src/ray/(util|raylet_client|internal|scheduling|pubsub|rpc(?:/.*)?)/.*\.(h|cc)$

- repo: https://github.com/keith/pre-commit-buildifier
rev: 8.0.1
Expand Down
14 changes: 10 additions & 4 deletions src/ray/internal/internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

#include "ray/internal/internal.h"

#include <memory>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

#include "ray/core_worker/core_worker.h"

namespace ray {
Expand All @@ -38,14 +44,14 @@ std::vector<rpc::ObjectReference> SendInternal(
TaskOptions options{name, return_num, resources};

char meta_data[3] = {'R', 'A', 'W'};
std::shared_ptr<LocalMemoryBuffer> meta =
std::make_shared<LocalMemoryBuffer>((uint8_t *)meta_data, 3, true);
auto meta = std::make_shared<LocalMemoryBuffer>(
reinterpret_cast<uint8_t *>(meta_data), 3, true);

std::vector<std::unique_ptr<TaskArg>> args;
if (function.GetLanguage() == Language::PYTHON) {
auto dummy = "__RAY_DUMMY__";
std::shared_ptr<LocalMemoryBuffer> dummyBuffer =
std::make_shared<LocalMemoryBuffer>((uint8_t *)dummy, 13, true);
auto dummyBuffer = std::make_shared<LocalMemoryBuffer>(
reinterpret_cast<uint8_t *>(const_cast<char *>(dummy)), 13, true);
args.emplace_back(new TaskArgByValue(std::make_shared<RayObject>(
std::move(dummyBuffer), meta, std::vector<rpc::ObjectReference>(), true)));
}
Expand Down
5 changes: 5 additions & 0 deletions src/ray/internal/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
// limitations under the License.

#pragma once

#include <memory>
#include <string>
#include <vector>

#include "ray/common/buffer.h"
#include "ray/common/id.h"
#include "ray/core_worker/common.h"
Expand Down

0 comments on commit 7c8e1c8

Please sign in to comment.