Fortran Coder

查看: 7445|回复: 1
打印 上一主题 下一主题

[编译器] I V F中Cray pointer 怎么用

[复制链接]

1

帖子

1

主题

0

精华

新人

F 币
10 元
贡献
4 点
跳转到指定楼层
楼主
发表于 2016-4-8 18:47:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
I V F中Cray pointer 怎么用,或者怎么改成可执行的?
分享到:  微信微信
收藏收藏 点赞点赞 点踩点踩

1963

帖子

12

主题

5

精华

论坛跑堂

臭石头雪球

F 币
1357 元
贡献
574 点

美女勋章热心勋章星光勋章新人勋章贡献勋章管理勋章帅哥勋章爱心勋章规矩勋章元老勋章水王勋章

沙发
发表于 2016-4-9 08:26:13 | 只看该作者
也许以下帮助文档里的内容可以给你启发:

Consider the following:
[Fortran] 纯文本查看 复制代码
pointer (pb, b)
pb = getstorage()
do i = 1, n
  b(i) = a(i) + 1
enddo

By default, the compiler assumes that b and a are aliased. To prevent such an assumption, specify the -safe-cray-ptr (Linux* OS and OS X*) or /Qsafe-cray-ptr (Windows* OS) option, and the compiler will treat b(i) and a(i) as independent of each other.

However, if the variables are intended to be aliased with Cray pointers, using the option produces incorrect results. In the following example, you should not use the option:
[Fortran] 纯文本查看 复制代码
pointer (pb, b)
pb = loc(a(2))
do i=1, n
  b(i) = a(i) +1
enddo
您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )

GMT+8, 2024-5-7 07:42

Powered by Tencent X3.4

© 2013-2024 Tencent

快速回复 返回顶部 返回列表