LoginSignup
0
0

More than 5 years have passed since last update.

C > C99 > restrict キーワード > link || 実装ソースのコメント

Last updated at Posted at 2018-07-14
動作環境
GeForce GTX 1070 (8GB)
ASRock Z170M Pro4S [Intel Z170chipset]
Ubuntu 16.04.4 LTS desktop amd64
TensorFlow v1.7.0
cuDNN v5.1 for Linux
CUDA v8.0
Python 3.5.2
IPython 6.0.0 -- An enhanced Interactive Python.
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
scipy v0.19.1
geopandas v0.3.0
MATLAB R2017b (Home Edition)
ADDA v.1.3b6
gnustep-gui-runtime v0.24.0-3.1
PyMieScatt v1.7.0

ADDA v1.3b6に出てくる下記の実装。

interaction.c
// tables of integrals
static double * restrict tab1,* restrict tab2,* restrict tab3,* restrict tab4,* restrict tab5,* restrict tab6,
    * restrict tab7,* restrict tab8,* restrict tab9,* restrict tab10;

関連して下記を見つけた。

情報感謝です

ADDAでは様々な場所にrestrictが使用されている。

ADDAのiterative.cSwapPointers()に下記のようなコメントもある (赤字はこちらで強調)。

swap two pointers of (doublecomplex *) type; should work for others but will give "Suspicious pointer conversion" warning. While this is a convenient function that can save some copying between memory blocks, it doesn't allow consistent usage of 'restrict' keyword for affected pointers. This may hamper some optimizations. Hopefully, the most important optimizations are those in the linalg.c, which can be improved by using 'restrict' keyword in the functions themselves.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0