Skip to content

Commit 73dde45

Browse files
VasuAgrawalpytorchmergebot
authored andcommitted
[pytorch] Sprinkle in a few template keywords (pytorch#145877)
Summary: These seem to be necessary to get compilation working on Windows with CUDA 12.8. I'm not sure whether this means that all of the previous compilers were broken, and the new one is better, or whether this is a regression in NVCC 12.8. Either way, as long as the CI passes for existing versions, this should unblock us from CUDA 12.8 enablement on Windows. See D68663662 for more details on the CUDA 12.8 enablement. Test Plan: CI! Reviewed By: akrieger Differential Revision: D68787925 Pull Request resolved: pytorch#145877 Approved by: https://github.com/Skylion007
1 parent 7269995 commit 73dde45

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

aten/src/ATen/core/boxing/impl/boxing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ struct PopResult<std::tuple<Types...>> final {
195195
static Result pop_to_tuple_impl(
196196
Stack& stack,
197197
std::index_sequence<indices...>) {
198-
return std::make_tuple((std::move(stack[indices]).to<Types>())...);
198+
return std::make_tuple((std::move(stack[indices]).template to<Types>())...);
199199
}
200200
};
201201

aten/src/ATen/core/ivalue_inl.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,7 +1780,7 @@ std::vector<Elem> generic_to(IValue ivalue, _fake_type<std::vector<Elem>>) {
17801780
// We need to do a deep copy of the vector because there might be other
17811781
// references to this same IValue that also use the list. We can't just
17821782
// move the elements out.
1783-
auto list = std::move(ivalue).to<List<Elem>>();
1783+
auto list = std::move(ivalue).template to<List<Elem>>();
17841784
std::vector<Elem> result;
17851785
result.reserve(list.size());
17861786
for (Elem v : list) {
@@ -1828,7 +1828,7 @@ c10::intrusive_ptr<T> IValue::toCustomClass() const& {
18281828
template <typename T>
18291829
T generic_to(IValue ivalue, _fake_type<T>) {
18301830
using ElemType = typename std::remove_pointer<T>::type::element_type;
1831-
return std::move(ivalue).toCustomClass<ElemType>();
1831+
return std::move(ivalue).template toCustomClass<ElemType>();
18321832
}
18331833

18341834
template <typename T>
@@ -1872,7 +1872,7 @@ OptionalArray<T> generic_to(IValue ivalue, _fake_type<OptionalArray<T>>) {
18721872
return {};
18731873
}
18741874
return createVectorFromList<T>(
1875-
std::move(ivalue).to<c10::List<T>>()
1875+
std::move(ivalue).template to<c10::List<T>>()
18761876
);
18771877
}
18781878

@@ -1885,7 +1885,7 @@ std::array<Elem, sizeof...(I)> generic_to_array(
18851885
// We need to do a deep copy of the array because there might be other
18861886
// references to this same IValue that also use the list. We can't just
18871887
// move the elements out.
1888-
auto list = std::move(ivalue).to<List<Elem>>();
1888+
auto list = std::move(ivalue).template to<List<Elem>>();
18891889
TORCH_CHECK(
18901890
list.size() == sizeof...(I),
18911891
"Tried to convert a List with ",
@@ -1930,7 +1930,7 @@ std::optional<T> generic_to(IValue ivalue, _fake_type<std::optional<T>>) {
19301930
if (ivalue.isNone()) {
19311931
return std::nullopt;
19321932
}
1933-
return std::move(ivalue).to<T>();
1933+
return std::move(ivalue).template to<T>();
19341934
}
19351935

19361936
namespace detail {

0 commit comments

Comments
 (0)