Skip to content

Commit c06c89f

Browse files
SS-JIAfacebook-github-bot
authored andcommitted
Update namespace from at::native::vulkan to vkcompute (#2798)
Summary: Pull Request resolved: #2798 ## Context The previous change in the stack forks the Vulkan Compute API into the ExecuTorch directory. Now that there is no longer any dependency on ATen-Vulkan, the `at::native::vulkan` namespace is deprecated in favor of `vkcompute`. bypass-github-export-checks Reviewed By: jorgep31415 Differential Revision: D55608083 fbshipit-source-id: bfe7564359b19daf4356c54d9a2c0e967171d25f
1 parent a6e7317 commit c06c89f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+176
-564
lines changed

backends/vulkan/runtime/VulkanBackend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace executor {
3232
namespace vulkan {
3333
namespace {
3434

35-
using namespace at::native::vulkan;
35+
using namespace vkcompute;
3636

3737
// Flatbuffer types
3838
using VkGraphPtr = const vkgraph::VkGraph*;

backends/vulkan/runtime/api/Adapter.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
#include <sstream>
1515
#include <utility>
1616

17-
namespace at {
18-
namespace native {
19-
namespace vulkan {
17+
namespace vkcompute {
2018
namespace api {
2119

2220
PhysicalDevice::PhysicalDevice(VkPhysicalDevice physical_device_handle)
@@ -444,6 +442,4 @@ std::ostream& operator<<(std::ostream& os, const Adapter& adapter) {
444442
}
445443

446444
} // namespace api
447-
} // namespace vulkan
448-
} // namespace native
449-
} // namespace at
445+
} // namespace vkcompute

backends/vulkan/runtime/api/Adapter.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// @lint-ignore-every CLANGTIDY facebook-hte-BadMemberName
1212

13-
#ifdef USE_VULKAN_API
14-
1513
#include <executorch/backends/vulkan/runtime/api/vk_api.h>
1614

1715
#include <executorch/backends/vulkan/runtime/api/Pipeline.h>
@@ -22,9 +20,7 @@
2220
#include <mutex>
2321
#include <ostream>
2422

25-
namespace at {
26-
namespace native {
27-
namespace vulkan {
23+
namespace vkcompute {
2824
namespace api {
2925

3026
struct PhysicalDevice final {
@@ -218,8 +214,4 @@ class Adapter final {
218214
};
219215

220216
} // namespace api
221-
} // namespace vulkan
222-
} // namespace native
223-
} // namespace at
224-
225-
#endif /* USE_VULKAN_API */
217+
} // namespace vkcompute

backends/vulkan/runtime/api/Allocator.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
#include <executorch/backends/vulkan/runtime/api/vk_api.h>
1717

18-
#ifdef USE_VULKAN_API
19-
2018
#define VMA_VULKAN_VERSION 1000000
2119

2220
#ifdef USE_VULKAN_WRAPPER
@@ -60,5 +58,3 @@
6058
#ifdef __clang__
6159
#pragma clang diagnostic pop
6260
#endif /* __clang__ */
63-
64-
#endif /* USE_VULKAN_API */

backends/vulkan/runtime/api/Command.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
#include <mutex>
1313

14-
namespace at {
15-
namespace native {
16-
namespace vulkan {
14+
namespace vkcompute {
1715
namespace api {
1816

1917
//
@@ -448,6 +446,4 @@ void CommandPool::allocate_new_batch(const uint32_t count) {
448446
}
449447

450448
} // namespace api
451-
} // namespace vulkan
452-
} // namespace native
453-
} // namespace at
449+
} // namespace vkcompute

backends/vulkan/runtime/api/Command.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// @lint-ignore-every CLANGTIDY facebook-hte-BadMemberName
1212

13-
#ifdef USE_VULKAN_API
14-
1513
#include <executorch/backends/vulkan/runtime/api/vk_api.h>
1614

1715
#include <executorch/backends/vulkan/runtime/api/Descriptor.h>
@@ -20,9 +18,7 @@
2018
#include <executorch/backends/vulkan/runtime/api/Shader.h>
2119
#include <executorch/backends/vulkan/runtime/api/Utils.h>
2220

23-
namespace at {
24-
namespace native {
25-
namespace vulkan {
21+
namespace vkcompute {
2622
namespace api {
2723

2824
class CommandBuffer final {
@@ -170,8 +166,4 @@ class CommandPool final {
170166
};
171167

172168
} // namespace api
173-
} // namespace vulkan
174-
} // namespace native
175-
} // namespace at
176-
177-
#endif /* USE_VULKAN_API */
169+
} // namespace vkcompute

backends/vulkan/runtime/api/Context.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
#define VULKAN_QUERY_POOL_SIZE 4096u
2121
#endif
2222

23-
namespace at {
24-
namespace native {
25-
namespace vulkan {
23+
namespace vkcompute {
2624
namespace api {
2725

2826
Context::Context(size_t adapter_i, const ContextConfig& config)
@@ -230,6 +228,4 @@ UniformParamsBuffer& UniformParamsBuffer::operator=(
230228
}
231229

232230
} // namespace api
233-
} // namespace vulkan
234-
} // namespace native
235-
} // namespace at
231+
} // namespace vkcompute

backends/vulkan/runtime/api/Context.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// @lint-ignore-every CLANGTIDY facebook-hte-BadMemberName
1212

13-
#ifdef USE_VULKAN_API
14-
1513
#include <executorch/backends/vulkan/runtime/api/vk_api.h>
1614

1715
#include <executorch/backends/vulkan/runtime/api/Adapter.h>
@@ -24,9 +22,7 @@
2422
#include <executorch/backends/vulkan/runtime/api/Shader.h>
2523
#include <executorch/backends/vulkan/runtime/api/Utils.h>
2624

27-
namespace at {
28-
namespace native {
29-
namespace vulkan {
25+
namespace vkcompute {
3026
namespace api {
3127

3228
struct ContextConfig final {
@@ -560,8 +556,4 @@ inline bool Context::submit_compute_job(
560556
}
561557

562558
} // namespace api
563-
} // namespace vulkan
564-
} // namespace native
565-
} // namespace at
566-
567-
#endif /* USE_VULKAN_API */
559+
} // namespace vkcompute

backends/vulkan/runtime/api/Descriptor.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
#include <algorithm>
1313
#include <utility>
1414

15-
namespace at {
16-
namespace native {
17-
namespace vulkan {
15+
namespace vkcompute {
1816
namespace api {
1917

2018
//
@@ -290,6 +288,4 @@ void DescriptorPool::flush() {
290288
}
291289

292290
} // namespace api
293-
} // namespace vulkan
294-
} // namespace native
295-
} // namespace at
291+
} // namespace vkcompute

backends/vulkan/runtime/api/Descriptor.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,14 @@
1010

1111
// @lint-ignore-every CLANGTIDY facebook-hte-BadMemberName
1212

13-
#ifdef USE_VULKAN_API
14-
1513
#include <executorch/backends/vulkan/runtime/api/vk_api.h>
1614

1715
#include <executorch/backends/vulkan/runtime/api/Resource.h>
1816
#include <executorch/backends/vulkan/runtime/api/Shader.h>
1917

2018
#include <unordered_map>
2119

22-
namespace at {
23-
namespace native {
24-
namespace vulkan {
20+
namespace vkcompute {
2521
namespace api {
2622

2723
class DescriptorSet final {
@@ -141,8 +137,4 @@ class DescriptorPool final {
141137
};
142138

143139
} // namespace api
144-
} // namespace vulkan
145-
} // namespace native
146-
} // namespace at
147-
148-
#endif /* USE_VULKAN_API */
140+
} // namespace vkcompute

backends/vulkan/runtime/api/Exception.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
#include <sstream>
1212

13-
namespace at {
14-
namespace native {
15-
namespace vulkan {
13+
namespace vkcompute {
1614
namespace api {
1715

1816
#define VK_RESULT_CASE(code) \
@@ -80,6 +78,4 @@ Error::Error(SourceLocation source_location, const char* cond, std::string msg)
8078
}
8179

8280
} // namespace api
83-
} // namespace vulkan
84-
} // namespace native
85-
} // namespace at
81+
} // namespace vkcompute

backends/vulkan/runtime/api/Exception.h

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#pragma once
1010
// @lint-ignore-every CLANGTIDY facebook-hte-BadMemberName
11-
#ifdef USE_VULKAN_API
1211

1312
#include <exception>
1413
#include <ostream>
@@ -18,37 +17,34 @@
1817
#include <executorch/backends/vulkan/runtime/api/StringUtil.h>
1918
#include <executorch/backends/vulkan/runtime/api/vk_api.h>
2019

21-
#define VK_CHECK(function) \
22-
do { \
23-
const VkResult result = (function); \
24-
if (VK_SUCCESS != result) { \
25-
throw ::at::native::vulkan::api::Error( \
26-
{__func__, __FILE__, static_cast<uint32_t>(__LINE__)}, \
27-
::at::native::vulkan::api::concat_str( \
28-
#function, " returned ", result)); \
29-
} \
20+
#define VK_CHECK(function) \
21+
do { \
22+
const VkResult result = (function); \
23+
if (VK_SUCCESS != result) { \
24+
throw ::vkcompute::api::Error( \
25+
{__func__, __FILE__, static_cast<uint32_t>(__LINE__)}, \
26+
::vkcompute::api::concat_str(#function, " returned ", result)); \
27+
} \
3028
} while (false)
3129

3230
#define VK_CHECK_COND(cond, ...) \
3331
do { \
3432
if (!(cond)) { \
35-
throw ::at::native::vulkan::api::Error( \
33+
throw ::vkcompute::api::Error( \
3634
{__func__, __FILE__, static_cast<uint32_t>(__LINE__)}, \
3735
#cond, \
38-
::at::native::vulkan::api::concat_str(__VA_ARGS__)); \
36+
::vkcompute::api::concat_str(__VA_ARGS__)); \
3937
} \
4038
} while (false)
4139

4240
#define VK_THROW(...) \
4341
do { \
44-
throw ::at::native::vulkan::api::Error( \
42+
throw ::vkcompute::api::Error( \
4543
{__func__, __FILE__, static_cast<uint32_t>(__LINE__)}, \
46-
::at::native::vulkan::api::concat_str(__VA_ARGS__)); \
44+
::vkcompute::api::concat_str(__VA_ARGS__)); \
4745
} while (false)
4846

49-
namespace at {
50-
namespace native {
51-
namespace vulkan {
47+
namespace vkcompute {
5248
namespace api {
5349

5450
std::ostream& operator<<(std::ostream& out, const VkResult loc);
@@ -82,8 +78,4 @@ class Error : public std::exception {
8278
};
8379

8480
} // namespace api
85-
} // namespace vulkan
86-
} // namespace native
87-
} // namespace at
88-
89-
#endif /* USE_VULKAN_API */
81+
} // namespace vkcompute

backends/vulkan/runtime/api/Pipeline.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
#include <executorch/backends/vulkan/runtime/api/Pipeline.h>
1010

11-
namespace at {
12-
namespace native {
13-
namespace vulkan {
11+
namespace vkcompute {
1412
namespace api {
1513

1614
//
@@ -343,6 +341,4 @@ void ComputePipelineCache::purge() {
343341
}
344342

345343
} // namespace api
346-
} // namespace vulkan
347-
} // namespace native
348-
} // namespace at
344+
} // namespace vkcompute

backends/vulkan/runtime/api/Pipeline.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// @lint-ignore-every CLANGTIDY facebook-hte-BadMemberName
1212

13-
#ifdef USE_VULKAN_API
14-
1513
#include <executorch/backends/vulkan/runtime/api/vk_api.h>
1614

1715
#include <executorch/backends/vulkan/runtime/api/Resource.h>
@@ -20,9 +18,7 @@
2018
#include <mutex>
2119
#include <unordered_map>
2220

23-
namespace at {
24-
namespace native {
25-
namespace vulkan {
21+
namespace vkcompute {
2622
namespace api {
2723

2824
struct PipelineBarrier final {
@@ -205,8 +201,4 @@ class ComputePipelineCache final {
205201
//
206202

207203
} // namespace api
208-
} // namespace vulkan
209-
} // namespace native
210-
} // namespace at
211-
212-
#endif /* USE_VULKAN_API */
204+
} // namespace vkcompute

backends/vulkan/runtime/api/QueryPool.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
#include <iostream>
1919
#include <utility>
2020

21-
namespace at {
22-
namespace native {
23-
namespace vulkan {
21+
namespace vkcompute {
2422
namespace api {
2523

2624
namespace {
@@ -286,6 +284,4 @@ size_t QueryPool::shader_logs_entry_count() {
286284
}
287285

288286
} // namespace api
289-
} // namespace vulkan
290-
} // namespace native
291-
} // namespace at
287+
} // namespace vkcompute

0 commit comments

Comments
 (0)