Can I determine CPU cache sizes ?

Ask a Question related to Sun Solaris, Design and Development.

  1. #1

    Default Can I determine CPU cache sizes ?

    Is there a way to determine the size of the L1 data cache, L1
    instruction cache and L2 cache in Solaris from a C system call - i.e.
    I **don't** want to use a command at the shell prompt?

    I know the Sun compiler uses this information to optimise the code,
    but I don't know whether it uses a system call to get the information
    or just has a huge lookup table, that knows about each CPU.


    --
    Dr. David Kirkby,
    Senior Research Fellow,
    Department of Medical Physics,
    University College London,
    11-20 Capper St, London, WC1E 6JA.
    Tel: 020 7679 6408 Fax: 020 7679 6269
    Internal telephone: ext 46408
    e-mail [email]davek@medphys.ucl.ac.uk[/email]
    Dr. David Kirkby Guest

  2. Similar Questions and Discussions

    1. Use a PDF TK to determine if ....
      So what can be done?
    2. determine if a number is even or odd in php
      hi, working on a site that uses php and mysql. on one page, i pull data from a database and put it into a table. the data is about scientific...
    3. Determine if a date is during DST
      Is there an easy way in coldfusion to determine if a give date/time happened/will happen during Daylight Saving Time? I can find out if the server...
    4. Using ASP to determine the OS
      I want to determine the operating system using ASP (or VBScript inside of ASP). I tried to get it using the Request....
    5. CSS is different sizes
      I am definately going crazy. I have 3 styles, in an empty doc. (I will attatch at bottom) The three styles are exactly identical except color,...
  3. #2

    Default Re: Can I determine CPU cache sizes ?

    In <3F207848.F5AFFBA9@ntlworld.com> "Dr. David Kirkby" <drkirkby@ntlworld.com> writes:
    >Is there a way to determine the size of the L1 data cache, L1
    >instruction cache and L2 cache in Solaris from a C system call
    >I know the Sun compiler uses this information to optimise the code,
    >but I don't know whether it uses a system call to get the information
    >or just has a huge lookup table, that knows about each CPU.
    even if it did have a lookup table it would still require some
    sort of system call to determine the cpu type to determine which
    table entry to use.

    find the information you want in the output of "prtpicl -v -c cpu"
    then use the interfaces described in libpicl(3LIB) to do the same thing
    in your own code.
    ultrasparc3@hotmail.com Guest

  4. #3

    Default Re: Can I determine CPU cache sizes ?

    [email]ultrasparc3@hotmail.com[/email] wrote:
    >
    > In <3F207848.F5AFFBA9@ntlworld.com> "Dr. David Kirkby" <drkirkby@ntlworld.com> writes:
    > >Is there a way to determine the size of the L1 data cache, L1
    > >instruction cache and L2 cache in Solaris from a C system call
    >
    > >I know the Sun compiler uses this information to optimise the code,
    > >but I don't know whether it uses a system call to get the information
    > >or just has a huge lookup table, that knows about each CPU.
    >
    > even if it did have a lookup table it would still require some
    > sort of system call to determine the cpu type to determine which
    > table entry to use.
    True, but one might image there being a call to get the cpu type, but
    not the detailed information about the cpu.

    > find the information you want in the output of "prtpicl -v -c cpu"
    > then use the interfaces described in libpicl(3LIB) to do the same thing
    > in your own code.
    Thanks, that is useful.

    --
    Dr. David Kirkby,
    Senior Research Fellow,
    Department of Medical Physics,
    University College London,
    11-20 Capper St, London, WC1E 6JA.
    Tel: 020 7679 6408 Fax: 020 7679 6269
    Internal telephone: ext 46408
    e-mail [email]davek@medphys.ucl.ac.uk[/email]
    Dr. David Kirkby Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139