Skip to content

Commit

Permalink
Move src/common to src/webnn/common
Browse files Browse the repository at this point in the history
Move src/webnn_wire to src/webnn/wire
Move src/webnn_native to webnn/native
Move src/include to include/
Move src/tests to src/webnn/tests
  • Loading branch information
lisa0314 authored and mingmingtasd committed May 11, 2022
1 parent b176643 commit 344fea2
Show file tree
Hide file tree
Showing 256 changed files with 854 additions and 951 deletions.
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import("scripts/webnn_overrides_with_defaults.gni")

group("all") {
testonly = true
deps = [ "src/tests:webnn_tests" ]
deps = [ "src/webnn/tests:webnn_tests" ]
if (webnn_standalone) {
deps += [ "examples:webnn_samples" ]
}
Expand Down
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ hooks = [
'name': 'download_dml_unpkg',
'pattern': '.',
'condition': 'checkout_win',
'action': ['python3', 'src/webnn_native/dml/deps/script/download_dml.py'],
'action': ['python3', 'src/webnn/native/dml/deps/script/download_dml.py'],
}
]

Expand Down
12 changes: 6 additions & 6 deletions examples/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ static_library("webnn_sample_utils") {

# Export all of these as public deps so that `gn check` allows includes
public_deps = [
"${webnn_root}/src/common",
"${webnn_root}/src/utils:webnn_utils",
"${webnn_root}/src/webnn:cpp",
"${webnn_root}/src/webnn:webnn_proc",
"${webnn_root}/src/webnn:webnncpp",
"${webnn_root}/src/webnn_native",
"${webnn_root}/src/webnn_wire",
"${webnn_root}/src/webnn/common",
"${webnn_root}/src/webnn/native:webnn_native",
"${webnn_root}/src/webnn/utils:webnn_utils",
"${webnn_root}/src/webnn/wire:webnn_wire",
]

defines = [
Expand All @@ -58,7 +58,7 @@ static_library("webnn_sample_utils") {
]
}

public_configs = [ "${webnn_root}/src/common:dawn_internal" ]
public_configs = [ "${webnn_root}/src/webnn/common:internal_config" ]
if (is_linux) {
public_configs += [ "//build/config//gcc:rpath_for_built_shared_libraries" ]
}
Expand Down
16 changes: 8 additions & 8 deletions examples/SampleUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@

#include "common/Assert.h"
#include "common/Log.h"
#include "utils/TerribleCommandBuffer.h"
#include "webnn_native/NamedInputs.h"
#include "webnn_native/NamedOperands.h"
#include "webnn_native/NamedOutputs.h"

#include "webnn/native/NamedInputs.h"
#include "webnn/native/NamedOperands.h"
#include "webnn/native/NamedOutputs.h"
#include "webnn/utils/TerribleCommandBuffer.h"
#include "webnn/wire/WireClient.h"
#include "webnn/wire/WireServer.h"

#include <webnn/native/WebnnNative.h>
#include <webnn/webnn.h>
#include <webnn/webnn_cpp.h>
#include <webnn/webnn_proc.h>
#include <webnn_native/WebnnNative.h>
#include <webnn_wire/WireClient.h>
#include <webnn_wire/WireServer.h>
#include <algorithm>
#include <cmath>
#include <fstream>
Expand Down
2 changes: 1 addition & 1 deletion examples/SqueezeNet/SqueezeNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,4 @@ const wnn::Operand SqueezeNet::LoadNHWC(const wnn::GraphBuilder& builder, bool s
const wnn::Operand reshape = builder.Reshape(averagePool2d, newShape.data(), newShape.size());
const wnn::Operand output = softmax ? builder.Softmax(reshape) : reshape;
return output;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
//* See the License for the specific language governing permissions and
//* limitations under the License.

#include "webnn_native/webnn_platform.h"
#include "webnn_native/WebnnNative.h"
#include "webnn/native/webnn_platform.h"
#include "webnn/native/WebnnNative.h"

#include <algorithm>
#include <vector>

{% for type in by_category["object"] %}
{% if type.name.canonical_case() not in ["texture view"] %}
#include "webnn_native/{{type.name.CamelCase()}}.h"
#include "webnn/native/{{type.name.CamelCase()}}.h"
{% endif %}
{% endfor %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//* See the License for the specific language governing permissions and
//* limitations under the License.

#include "webnn_native/ValidationUtils_autogen.h"
#include "webnn/native/ValidationUtils_autogen.h"

namespace webnn::native {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "webnn/webnn_cpp.h"

#include "webnn_native/Error.h"
#include "webnn/native/Error.h"

namespace webnn::native {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define WEBNN_NATIVE_WEBNN_PLATFORM_AUTOGEN_H_

#include "webnn/webnn_cpp.h"
#include "webnn_native/Forward.h"
#include "webnn/native/Forward.h"

namespace webnn::native {

Expand All @@ -31,4 +31,4 @@ namespace webnn::native {
{% endfor %}
}

#endif // WEBNN_NATIVE_WEBNN_PLATFORM_AUTOGEN_H_
#endif // WEBNN_NATIVE_WEBNN_PLATFORM_AUTOGEN_H_
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//* See the License for the specific language governing permissions and
//* limitations under the License.

#include "webnn_native/webnn_structs_autogen.h"
#include "webnn/native/webnn_structs_autogen.h"

namespace webnn::native {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define WEBNN_NATIVE_WEBNN_STRUCTS_H_

#include "webnn/webnn_cpp.h"
#include "webnn_native/Forward.h"
#include "webnn/native/Forward.h"

namespace webnn::native {

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
//* See the License for the specific language governing permissions and
//* limitations under the License.

#include "webnn_wire/WireCmd_autogen.h"
#include "webnn/wire/WireCmd_autogen.h"

#include "common/Assert.h"
#include "webnn_wire/Wire.h"
#include "webnn/wire/Wire.h"

#include <algorithm>
#include <cstring>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <webnn/webnn.h>

#include "webnn_wire/ObjectType_autogen.h"
#include "webnn/wire/ObjectType_autogen.h"

namespace webnn::wire {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#ifndef WEBNNNWIRE_CLIENT_APIOBJECTS_AUTOGEN_H_
#define WEBNNNWIRE_CLIENT_APIOBJECTS_AUTOGEN_H_

#include "webnn_wire/ObjectType_autogen.h"
#include "webnn_wire/client/ObjectBase.h"
#include "webnn/wire/ObjectType_autogen.h"
#include "webnn/wire/client/ObjectBase.h"

namespace webnn::wire::client {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
//* limitations under the License.

#include "common/Log.h"
#include "webnn_wire/client/ApiObjects.h"
#include "webnn_wire/client/Client.h"
#include "webnn/wire/client/ApiObjects.h"
#include "webnn/wire/client/Client.h"

#include <algorithm>
#include <cstring>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
#ifndef DAWNWIRE_CLIENT_CLIENTBASE_AUTOGEN_H_
#define DAWNWIRE_CLIENT_CLIENTBASE_AUTOGEN_H_

#include "webnn_wire/ChunkedCommandHandler.h"
#include "webnn_wire/WireCmd_autogen.h"
#include "webnn_wire/client/ApiObjects.h"
#include "webnn_wire/client/ObjectAllocator.h"
#include "webnn/wire/ChunkedCommandHandler.h"
#include "webnn/wire/WireCmd_autogen.h"
#include "webnn/wire/client/ApiObjects.h"
#include "webnn/wire/client/ObjectAllocator.h"

namespace webnn::wire::client {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//* limitations under the License.

#include "common/Assert.h"
#include "webnn_wire/client/Client.h"
#include "webnn/wire/client/Client.h"

#include <string>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
#define WEBNNIRE_SERVER_SERVERBASE_H_

#include "webnn/webnn_proc_table.h"
#include "webnn_wire/ChunkedCommandHandler.h"
#include "webnn_wire/Wire.h"
#include "webnn_wire/WireCmd_autogen.h"
#include "webnn_wire/WireDeserializeAllocator.h"
#include "webnn_wire/server/ObjectStorage.h"
#include "webnn/wire/ChunkedCommandHandler.h"
#include "webnn/wire/Wire.h"
#include "webnn/wire/WireCmd_autogen.h"
#include "webnn/wire/WireDeserializeAllocator.h"
#include "webnn/wire/server/ObjectStorage.h"

namespace webnn::wire::server {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//* limitations under the License.

#include "common/Assert.h"
#include "webnn_wire/server/Server.h"
#include "webnn/wire/server/Server.h"

namespace webnn::wire::server {
//* Implementation of the command doers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//* limitations under the License.

#include "common/Assert.h"
#include "webnn_wire/server/Server.h"
#include "webnn/wire/server/Server.h"

namespace webnn::wire::server {
{% for command in cmd_records["command"] %}
Expand Down
6 changes: 3 additions & 3 deletions generator/webnn_generator.gni
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import("../scripts/webnn_overrides_with_defaults.gni")
# 1. The generated output file directory structure has to match the structure
# of the source tree, starting at dawn_gen_root (gen/ or
# gen/third_party/dawn depending on where we are).
# 2. src/include and dawn_gen_root/src/include has to match the structure of
# 2. include and dawn_gen_root/include has to match the structure of
# the source tree too.
# 3. Dawn files must use include relative to src/ or src/include such as
# 3. Dawn files must use include relative to src/ or include such as
# "dawn/dawn.h" or "dawn_native/backend/BackendStuff.h".
#
# The allowed list below ensure 1). Include directory rules for Dawn ensure 3)
Expand All @@ -44,7 +44,7 @@ webnn_allowed_gen_output_dirs = [
"src/webnn/wire/client/",
"src/webnn/wire/server/",
"src/webnn/wire/",
"src/include/webnn/",
"include/webnn/",
]

# Template to help invoking Dawn code generators based on generator_lib
Expand Down
Loading

0 comments on commit 344fea2

Please sign in to comment.