File: FindBLIS.cmake

package info (click to toggle)
pytorch 1.13.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 139,252 kB
  • sloc: cpp: 1,100,274; python: 706,454; ansic: 83,052; asm: 7,618; java: 3,273; sh: 2,841; javascript: 612; makefile: 323; xml: 269; ruby: 185; yacc: 144; objc: 68; lex: 44
file content (70 lines) | stat: -rw-r--r-- 1,717 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# - Find BLIS library
#
# This module sets the following variables:
#  BLIS_FOUND - set to true if a library implementing CBLAS interface is found.
#  BLIS_INCLUDE_DIR - path to include dir.
#  BLIS_LIB - list of libraries for BLIS.
#
# CPU only Dockerfile to build with AMD BLIS is available at the location
# pytorch/docker/pytorch/cpu-blis/Dockerfile
#


SET(BLIS_INCLUDE_SEARCH_PATHS
  /usr/include/blis
  /usr/local/include
  /usr/local/include/blis
  /opt/blis/include
  $ENV{BLIS_HOME}
  $ENV{BLIS_HOME}/include
  $ENV{BLIS_HOME}/include/blis
)

SET(BLIS_LIB_SEARCH_PATHS
  /lib/blis
  /lib64/blis
  /usr/lib/blis
  /usr/lib64/blis
  /usr/local/blis/lib
  /opt/blis/lib
  $ENV{BLIS_HOME}
  $ENV{BLIS_HOME}/lib
)

FIND_PATH(BLIS_INCLUDE_DIR NAMES cblas.h blis.h
          PATHS ${BLIS_INCLUDE_SEARCH_PATHS})
#    Check include files
IF(NOT BLIS_INCLUDE_DIR)
        SET(BLIS_FOUND OFF)
        MESSAGE(WARNING "Could not find BLIS include. Turning BLIS_FOUND off")
        RETURN()
ENDIF()


FIND_LIBRARY(BLIS_LIB NAMES blis PATHS ${BLIS_LIB_SEARCH_PATHS})
#    Check libraries
IF(NOT BLIS_LIB)
        SET(BLIS_FOUND OFF)
        MESSAGE(WARNING "Could not find BLIS lib. Turning BLIS_FOUND off")
        RETURN()
ENDIF()

SET(BLIS_FOUND ON)

IF(BLIS_FOUND)
        IF(NOT BLIS_FIND_QUIETLY)
                MESSAGE(STATUS "Found BLIS libraries: ${BLIS_LIB}")
                MESSAGE(STATUS "Found BLIS include: ${BLIS_INCLUDE_DIR}")
        ENDIF()
ELSE()
        MESSAGE(FATAL_ERROR "Could not find BLIS")
ENDIF()

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BLIS DEFAULT_MSG BLIS_INCLUDE_DIR BLIS_LIB)

MARK_AS_ADVANCED(
        BLIS_INCLUDE_DIR
        BLIS_LIB
        blis
)