pytorch/cmake
Yang Chen ca679384c2 [rocm][cmake] correctly check the ROCM_SOURCE_DIR environment (#120858)
The existing use of "if(NOT ENV{ROCM_SOURCE_DIR})" seems to be
not working correctly, e.g.

```
$ cmake --version
cmake version 3.26.4

$ cat CMakeList.txt
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
project(FOO)

if(NOT ENV{ROCM_SOURCE_DIR})
  message(INFO ": not defined 1")
else()
  message(INFO ": defined 1: $ENV{ROCM_SOURCE_DIR}")
endif()

if("$ENV{ROCM_SOURCE_DIR}" STREQUAL "")
  message(INFO ": not defined 2")
else()
  message(INFO ": defined 2: $ENV{ROCM_SOURCE_DIR}")
endif()
$ ROCM_SOURCE_DIR=/tmp cmake .
INFO: not defined 1
INFO: defined 2: /tmp
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/yangche/tmp/tmp
```

This PR replace it with a STREQUAL check. Note that the choice
of STREQUAL is to avoid cases like:

```
$ ROCM_SOURCE_DIR= cmake .
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/120858
Approved by: https://github.com/jianyuh, https://github.com/jeffdaily
2024-02-29 17:49:00 +00:00
..
External Re-add initial Flash Attention support on ROCM (#115981) 2024-01-04 22:21:31 +00:00
Modules enable mkl_gemm_f16f16f32 in cpublas::gemm (#118367) 2024-01-31 18:37:42 +00:00
Modules_CUDA_fix Add 9.0a to cpp_extension supported compute archs (#110587) 2023-10-05 17:41:06 +00:00
public Check existence of caffe2::mkl target (#119945) 2024-02-15 06:28:17 +00:00
Allowlist.cmake
BuildVariables.cmake
Caffe2Config.cmake.in [2/4] Intel GPU Runtime Upstreaming for Device (#116833) 2024-01-18 05:02:42 +00:00
CheckAbi.cmake
cmake_uninstall.cmake.in
Codegen.cmake [Cmake] Check that gcc-9.4 or newer is used (#112858) 2023-11-06 17:19:53 +00:00
DebugHelper.cmake
Dependencies.cmake [rocm][cmake] correctly check the ROCM_SOURCE_DIR environment (#120858) 2024-02-29 17:49:00 +00:00
FlatBuffers.cmake
GoogleTestPatch.cmake
IncludeSource.cpp.in
iOS.cmake [executorch] Update iOS toolchain with a modern cmake syntax. (#115799) 2023-12-15 00:51:30 +00:00
Metal.cmake
MiscCheck.cmake
ProtoBuf.cmake
ProtoBufPatch.cmake
Summary.cmake [1/4] Intel GPU Runtime Upstreaming for Device (#116019) 2024-01-12 07:36:25 +00:00
TorchConfig.cmake.in Revert "[Reland2] Update NVTX to NVTX3 (#109843)" 2023-12-05 16:10:20 +00:00
TorchConfigVersion.cmake.in
VulkanCodegen.cmake [pt-vulkan] Enable Python code blocks in shader templates and upgrade shader template generation (#115948) 2023-12-20 05:47:33 +00:00
VulkanDependencies.cmake