GVKun编程网logo

c – 使用带有Eigen的CUDA时找不到math_functions.hpp(include 找不到)

14

在这篇文章中,我们将为您详细介绍c–使用带有Eigen的CUDA时找不到math_functions.hpp的内容,并且讨论关于include找不到的相关问题。此外,我们还会涉及一些关于asp.net

在这篇文章中,我们将为您详细介绍c – 使用带有Eigen的CUDA时找不到math_functions.hpp的内容,并且讨论关于include 找不到的相关问题。此外,我们还会涉及一些关于asp.net-core – 来自带有Entity Framework Core的Data Tier中的appsettings.json的ConnectionString、Azure Functions :如何使用本地调试模式将日志写入 Azure Application Insights 和 Azure Functions 使用 Python?、c# – EntityFunctions.TruncateTime和DbFunctions.TruncateTime方法有什么区别?、c# – MYSQL中不存在Canonical Function“EntityFunctions.TruncateTime”的知识,以帮助您更全面地了解这个主题。

本文目录一览:

c – 使用带有Eigen的CUDA时找不到math_functions.hpp(include<algorithm> 找不到)

c – 使用带有Eigen的CUDA时找不到math_functions.hpp(include 找不到)

我有一些严重依赖于Eigen的代码.我想用CUDA优化它,但是当我编译时,我得到:

[tcai4@golubh4 Try1]$nvcc conv_parallel.cu -I /home/tcai4/project-cse/Try1 -lfftw3 -o conv.o
In file included from Eigen/Dense:1,from Eigen/Eigen:1,from functions.h:8,from conv_parallel.cu:10:
Eigen/Core:44:34: error: math_functions.hpp: No such file or directory

我认为math_functions.hpp是来自CUDA的文件.有人能帮我搞清楚为什么nvcc找不到它?

编辑:我使用CUDA 5.5和Eigen 3.3,除了链接Eigen和fftw3库,我没有使用任何其他标志(你可以从我的代码中看到).

解决方法

nvcc无法找到有问题的文件的原因是因为该文件是CUDA数学库的一部分,CUDA数学库是在CUDA 6中引入的.几乎4年前的CUDA版本早于数学库的发布.您的CUDA版本不包含所述文件.

因此,您应该假设在没有首先更新到较新版本的CUDA工具包的情况下,您尝试执行的操作无法工作.

asp.net-core – 来自带有Entity Framework Core的Data Tier中的appsettings.json的ConnectionString

asp.net-core – 来自带有Entity Framework Core的Data Tier中的appsettings.json的ConnectionString

我有一个新的应用程序,我正在使用Entity Framework Core构建ASP.NET Core.该应用程序具有UI,模型,业务和数据层.在以前的ASP.NET版本中,您可以在web.config中设置连接字符串,默认情况下它将在引用的层中可用.在使用appsettings.json(或其他配置选项)的ASP.NET Core中,这似乎不是相同的情况?有关如何实现这一点的任何想法?我在数据层中配置了dbcontext,但我目前正在对连接字符串进行硬编码.

我看到的所有示例都在startup.cs的UI层中配置了dbcontext.这就是我想要避免的.

问题Here得到了主题.

解决方法

您可以轻松地将IServiceCollection的扩展方法添加到业务/服务层,并使用它来注册自己的依赖项.然后在启动时,您只需在服务层上调用该方法,而无需在Web应用程序中引用EntityFramework.

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;

namespace your.service.layer
{
    public static class MyServiceCollectionExtensions
    {
        public static IServiceCollection AddMyServiceDependencies(this IServiceCollection services,string connectionString)
        {
             services.AddEntityFrameworksqlServer()
            .AddDbContext<YourDbContext>((serviceProvider,options) =>
            options.UsesqlServer(connectionString)
                   .UseInternalServiceProvider(serviceProvider)
                   );
             return services;
        }
    }

}

启动:

using your.service.layer;

public void ConfigureServices(IServiceCollection services)
{
    var connectionString = Configuration.GetConnectionString("EntityFrameworkConnectionString");
    services.AddMyServiceDependencies(connectionString);
}

现在,您的网络应用仅需要对您的业务/服务层的引用,并且它不直接依赖于EntityFramework.

Azure Functions :如何使用本地调试模式将日志写入 Azure Application Insights 和 Azure Functions 使用 Python?

Azure Functions :如何使用本地调试模式将日志写入 Azure Application Insights 和 Azure Functions 使用 Python?

如何解决Azure Functions :如何使用本地调试模式将日志写入 Azure Application Insights 和 Azure Functions 使用 Python??

我想将日志写入 Azure Application Insights,但不知道如何实现。
我需要更新我的 azure 函数 local.settings.jsonhost.json 文件吗??
另外,我是否需要使用 init.py 文件中的调用特定函数将我的日志写入 Azure Application Insights?
你能分享一些写日志的例子吗? 请注意 - 我的 Azure 函数使用的是 python。
谢谢

解决方法

这是host.json:

{
    "version": "2.0","logging": {
        "applicationInsights": {
            "samplingSettings": {
                "isEnabled": true,"excludedTypes": "Request"
            }
        }
    }
}

这是官方设置:

https://docs.microsoft.com/en-us/azure/azure-functions/functions-host-json#applicationinsights

''applicationInsights.samplingSettings.isEnabled'' 是启用或禁用采样。

c# – EntityFunctions.TruncateTime和DbFunctions.TruncateTime方法有什么区别?

c# – EntityFunctions.TruncateTime和DbFunctions.TruncateTime方法有什么区别?

有什么区别:
EntityFunctions.TruncateTime

DbFunctions.TruncateTime methods?

解决方法

没有区别. EntityFunctions是出现在内置于.NET Framework(通过.NET 4.5)的实体框架的版本中的类. DbFunctions类在与.NET Framework分开运送的Entity Framework 6中引入.
对于从6.0开始使用EF版本的任何新应用程序,您应该使用DbFunctions类,因为其他类(和大部分内置的EF库)已被废弃,有利于单独部署的版本.

这两个函数只是代理调用,它们被转换为Entity Framework模型中的底层规范函数,最终转换为sql调用.

c# – MYSQL中不存在Canonical Function“EntityFunctions.TruncateTime”

c# – MYSQL中不存在Canonical Function“EntityFunctions.TruncateTime”

我正在尝试运行此查询:

DateTime DDate=DateTime.Today; //Today's date without Time
var v= db.measurements.Where(m => EntityFunctions.TruncateTime(m.InDate) == DDate);

它只返回那两个日期相等的对象,忽略时间部分.

但我收到:

{“FUNCTION [数据库] .TruncateTime不存在”}

堆栈跟踪:

at MysqL.Data.MysqLClient.MysqLStream.ReadPacket()
at MysqL.Data.MysqLClient.NativeDriver.GetResult(Int32& affectedRow,Int64& insertedId)
at MysqL.Data.MysqLClient.Driver.GetResult(Int32 statementId,Int32& affectedRows,Int64& insertedId)
at MysqL.Data.MysqLClient.Driver.NextResult(Int32 statementId,Boolean force)
at MysqL.Data.MysqLClient.MysqLDataReader.NextResult()
at MysqL.Data.MysqLClient.MysqLCommand.ExecuteReader(CommandBehavior behavior)
at MysqL.Data.Entity.EFMysqLCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.EntityClient.EntityCommandDeFinition.ExecuteStoreCommands(EntityCommand entityCommand,CommandBehavior behavior)

我正在使用:

> C#Visual Studio 2010
> EntityFramework 4数据库优先
> NetFramework 4
> MysqL Server 5.6

MysqL.Data和MysqL.Data.Entity的版本是6.6.5.0

TruncateTime is supported by MySQL.
Same thing happened to this person.

最佳答案
我无法解决它,所以我只是在数据库中创建了一个名为“TruncateTime”的函数.

Create FUNCTION TruncateTime(dateValue DateTime) RETURNS date
return Date(dateValue);

它有效,但我不喜欢它.

这些人做了类似的事情:

Alternative to EntityFunctions.AddSeconds for MySQL

CurrentUtcDateTime does not exist – Entity Framework and MySql

所以现在我认为这可能是不必要的,我可以直接从数据库中调用它并仍然获取实体,如下所示:

var x = db.ExecuteStoreQuery

就这样.

今天的关于c – 使用带有Eigen的CUDA时找不到math_functions.hppinclude 找不到的分享已经结束,谢谢您的关注,如果想了解更多关于asp.net-core – 来自带有Entity Framework Core的Data Tier中的appsettings.json的ConnectionString、Azure Functions :如何使用本地调试模式将日志写入 Azure Application Insights 和 Azure Functions 使用 Python?、c# – EntityFunctions.TruncateTime和DbFunctions.TruncateTime方法有什么区别?、c# – MYSQL中不存在Canonical Function“EntityFunctions.TruncateTime”的相关知识,请在本站进行查询。

本文标签: